Forum

Thread tagged as: Problem, Configuration, Blog

Markdown in a blog post

Morning all,

I'm having a bit of trouble with Markdown at the moment.

I've written a post which has some code blocks in it. I'm using Markdown to mark these blocks up and in the preview, it all works really well except for the less than (<) or greater than (>) symbols which are being output as text rather than html (see screenshot here > https://cl.ly/403J1z0O2s1Q)

Is there any reason why this is doing that?

Additionally, I'm trying to add an <aside> of text in but when adding <aside> into my Perch textarea, it's being parsed as text rather than HTML. I then tried adding a div in but that too is coming out as text rather than HTML > https://cl.ly/2M0L22060u32

What could be causing these issues?

My diagnostic report: -

SUMMARY INFORMATION

Perch: 2.8.23, PHP: 5.4.43, MySQL: 5.6.28, with PDO
Server OS: Linux, cgi-fcgi
Installed apps: content (2.8.23), assets (2.8.23), categories (2.8.23), perch_blog (4.6), perch_forms (1.8.3), perch_comments (1.1)
App runtimes: <?php include(PERCH_PATH.'/core/apps/content/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_forms/runtime.php'); include(PERCH_PATH.'/addons/apps/perch_blog/runtime.php'); include(PERCH_PATH.'/core/apps/categories/runtime.php'); ?>
PERCH_LOGINPATH: /perch
PERCH_PATH: /home/mrqwestc/public_html/mrqwest/perch
PERCH_CORE: /home/mrqwestc/public_html/mrqwest/perch/core
PERCH_RESFILEPATH: /home/mrqwestc/public_html/mrqwest/perch/resources
Image manipulation: GD Imagick
PHP limits: Max upload 2M, Max POST 8M, Memory: 128M, Total max file upload: 2M
F1: dc1fef2ad0fcd9f943c02ebb43d85dbc
Resource folder writeable: Yes
DOCUMENT_ROOT: /home/mrqwestc/public_html/mrqwest
HTTP_HOST: mrqwest.co.uk
REQUEST_URI: /perch/core/settings/diagnostics/
SCRIPT_NAME: /perch/core/settings/diagnostics/index.php

And here's my template code

<perch:blog id="postDescHTML" type="textarea" label="Post" order="2" editor="markitup" markdown="true" size="xxl autowidth" required="true" />
Anthony Killeen

Anthony Killeen 0 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you give an example of the input?

Just as an FYI, I've fixed the first issue by surrounding my code in 3 tilde's (~~~) rather than just indenting. That's fixed that but I'm not sure how to add in a div with class halfway through my content?

Drew, input for the second section here

<div class="aside">
this is my aside content.
</div>
Drew McLellan

Drew McLellan 2638 points
Perch Support

If you want that to literally be HTML, you need to add html="true" to your tag. Otherwise HTML is escaped by default.

Ahh, excellent - thanks Drew :)