What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

Within a <PRE> block, &para turns into a new paragraph symbol:

I use <PRE> blocks for code when I want to bold, so a function that's written

function go( ¶meter1, ¶meter2 ) { }

What's the dilly-yo

share|improve this question
What's the use case for bold in code blocks? I've never wanted that. And everything works just fine if you use markdown... –  Cody Gray Aug 4 '11 at 13:42
@Cody Bold in code blocks is useful to highlight specific things, and there were several feature requests to have it meta.stackoverflow.com/questions/32705/bold-code-in-a-question meta.stackoverflow.com/questions/54392/… meta.stackoverflow.com/questions/97383/… –  Daniel DiPaolo Aug 4 '11 at 14:16
@Daniel: Oh goodness, let's not do that. We'll get a whole bunch of questions from the gruff C and C++ communities complaining that using pointers now make their entire code blocks render in bold. I don't understand what's wrong with using comments to highlight specific things. You shouldn't be posting so much code that we need bold to see what to focus on in the first place. –  Cody Gray Aug 4 '11 at 14:21
<PRE> block is meant to display HTML and that's exactly what it's doing.. so it's not a bug. You might change it to feature request, asking to encode HTML entities inside <pre> sections. –  Shadow Wizard Aug 4 '11 at 14:43
add comment

1 Answer

up vote 10 down vote accepted

This is expected, since the browser thinks that it knows better than you do.

No conversion is done inside of raw HTML blocks by the Markdown parser, which means that your & isn't encoded to &amp; before being inserted into the HTML. Even though both the client and server-side parser return the literal &para in the source, the browser decides that you meant &para;, and renders ¶ instead.

If you're going to use raw HTML, you need to make sure you properly escape your entities manually:



share|improve this answer
actually, not "the browser thinks that it knows better than you do", but "markdown thinks you know better than it" :) –  balpha Aug 4 '11 at 16:03
True, although the browser is also being liberal in deciding what's an entity (since there's no ; there). Technically if it's using SGML rules, the first case could be considered valid, but the &parameter is just wrong. –  Tim Stone Aug 4 '11 at 16:07
No, the "browser does know better than you do". If it didn't, bobobobobobo would have written &amp; in the first place! –  SamB Feb 7 '12 at 1:05
Worked like charm! :) Was breaking my head with &para symbol for so long. –  Nariman Apr 7 at 10:12
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .