Given the following:
"This is the example of one paragraph.
And this is another paragraph."
If I render it in my template like this:
<div class='post-content'>
{{#markdown}}
{{body}}
{{/markdown}}
</div>
I get the output like this
<pre><code>This is the example of one paragraph.</code></pre>
<p>And this is another paragraph.
I tried this with marked and showdown.
The only way to get rid of the pre/code is to do this:
<div class='post-content'>
{{#markdown}}
{{body}}
{{/markdown}}
</div>
Which is weird. How do I make the whitespace ignored for the markdown block?
You are kind of contradicting yourself: whitespace has a meaning in markdown and you'd clearly like the whitespace in your body template to be interpreted correctly, so you can't ignore it.
Perhaps you like this formatting better, which should work as well. But all in all it's just an issue of pretty code formatting.
<div class='post-content'>
{{#markdown}}{{body}}{{/markdown}}
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With