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

Recently I was answering question with something like this ...

In the xml file you want to link to your style.xslt use

<?xml-stylesheet type="text/xsl" href="style.xslt"?>

I had to divide the line

In the xml file you want to link to your style.xslt use

and line

<?xml-stylesheet type="text/xsl" href="style.xslt"?>

with newline, in other case I got just

In the xml file you want to link to your style.xslt use

ignoring the second line, is this a bug? Is it at least documented somewhere?

share|improve this question
1  
Is there supposed to be a backtick in the first block you listed? It appears after "use" in the other blocks. –  Jason Plank Dec 13 '11 at 17:57
    
You know the difference between code blocks and quotes? If not: Markdown help helps. –  Arjan Dec 13 '11 at 17:59
    
edited, I copied it wrong, important thing is to notify that I used `` for xml line –  Ján Vorčák Dec 13 '11 at 17:59
    
just quoted it for this meta post, at SO I used the first line as plain text and second line as code block –  Ján Vorčák Dec 13 '11 at 18:00

3 Answers 3

up vote 4 down vote accepted

That's intentional, since Markdown supports hard-wrapped paragraphs which come with the requirement that text in different blocks is separated by one or more blank lines.

So, without the blank line, the Markdown parser sees your original syntax as a single line that contains some spaces followed by unescaped XML (that's stripped by the sanitizer), instead of a paragraph followed by an indented code block.

share|improve this answer

You have to indent XML blocks by 4 characters to get the code formatting to kick in and any sort of formatting requires a blank line before it before it works. I'm not sure if it's just a Markdown limitation or if that's just how Stack Exchange implements it, but either way this seems like it's to me.

share|improve this answer

The code block must be separated with an empty line from the previous text.

If you write the following text, it will not appear as you want, even though the code is indented with four spaces.

In the xml file you want to link to your style.xslt use
    <?xml-stylesheet type="text/xsl" href="style.xslt"?>

The text would appear as:

 

In the xml file you want to link to your style.xslt use

 

Add an empty line, and you get what you want:

 

In the xml file you want to link to your style.xslt use

<?xml-stylesheet type="text/xsl" href="style.xslt"?>
share|improve this answer

You must log in to answer this question.

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