HTML page field results in Uncaught Exception
Summary
Adding a custom page HTML field (called description in my case) and using it in a template, results in an Uncaught Exception:
Uncaught Exception
Class 'Markdown' not found
Origin
anchor\models\extend.php on line 49
Trace
#0 [internal function]: System\Error::shutdown()
#1 {main}
Expected Behaviour
The page field should yield the entered HTML instead of an exception.
Actual Behaviour
It yields the exception as described above.
- Anchor version: 0.12.1
- Server setup: XAMPP 5.6.20 (Apache 2.4.17, PHP 5.6.20)
To me it looks like the Markdown class hasn't been finished, but I'm not sure? I also replicated this issue within the Articles too. Can somebody with a bit more knowledge of the platform tell me whether using this https://github.com/michelf/php-markdown might be worth looking at?
@32leaves and @BenSeward, what's the current status of your situations with this? Have you tried updating to the master?
I got this error recently. Was there any solution? Cannot find it yet. Thanks
@sleepymonday which version are you using? did you download it from the repo?
Yes. I did download it from the repo. The version is 0.12.1 Main page of the blog loads correctly, but posts pages get that exact message.
@sleepymonday can you post the error you are getting, as the one in the original issue would not be the same as the markdown parser has been changed since it was posted

OK, it's a simple fix, in anchor/models/extend.php find
if( ! empty($extend->value->html)) {
$md = new Markdown;
$value = $md->transform($extend->value->html);
}
and replace it with
if (! empty($extend->value->html)) {
$value = parse($extend->value->html);
}
looks like the bundled release needs to be re-bundled
Thank you so much ! That fixed it :))
@sleepymonday no problem
@protomorph good work, but is this something that should be added to / accounted for in the codebase?
@daviddarnes it's already in both the master and pre-1.0 branches, the release needs to be re-bundled for it to be part of that