I'm using blocks to add chunks of example code to posts and pages.
The default editors seem a little wonky to me when it comes to code blocks, else I would have just used them. To overcome the wonkiness, I thought to just make the <code> element a part of the block and use striptags to remove any default tags(<p>) from the output. I've not had a problem with striptags adding an indent before, but yeah. I also checked the CSS and JS to see if it might be there, even though it works fine in the template, but alas, I can see no reason why this should occur.
Not exactly sure what, I'm missing here.
Here's the code:
Code
- <perch:block type="html" label="HTML">
- <pre class="snippet language-html">
- <code>
- <perch:blog id="htmlBlock" type="textarea" markdown editor="markitup" striptags size="xl" help="To render code, tab or indent four spaces.">
- </code>
- </pre>
- </perch:block>
- <perch:block type="cssCode" label="CSS">
- <pre class="snippet language-css">
- <perch:blog id="cssCodeBlock" type="textarea" markdown editor="simplemde" striptags size="xl" help="To render code, tab or indent four spaces.">
- </pre>
- </perch:block>
This is the input in the editor:
And here's the output: