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

I was editing a question to include the excerpt of what reported in the linked sites. I used the following Markdown, but it's not rendered how I would expect.

- [How Valentine's Day Works][1]  
> How about the "X" sign representing a kiss? This tradition started with the Medieval practice of allowing those who could not write to sign documents with an "X". This was done before witnesses, and the signer placed a kiss upon the "X" to show sincerity. This is how the kiss came to be synonymous with the letter "X", and how the "X" came to be commonly used at the end of letters as kiss symbols. (Some believed "X" was chosen as a variation on the cross symbol, while others believe it might have been a pledge in the name of Christ, since the "X"—or Chi symbol—is the twenty-second letter of the Greek alphabet and has been used in church history to represent Christ.)
- [Why Does X Stand for a Kiss?][2]  
> However, the prosaic explanation of this romantic sign may be twofold. Originally it represented the formalized, stylized pictures of 2 mouths X touching each other--X. But then, a little more complicated, the kiss entered the cross by a chain of events and really owes everything to men's lack of education.
>
Early illiterates signed documents with a cross. They did so for an obvious reason. A cross was so simple to draw, and yet, being also a sacred symbol, implied the promise of truth. But to solemnly confirm further the veracity of what had been endorsed thus, the writer kissed his 'signature,' as he was accustomed to do with the holy book. And that is how, finally, by its very association, the cross came to be identified with a kiss.

screenshot

The quoted part is not rendered as quoted, even though the bullet on the previous line is correctly rendered, and the quoted part has a correct indentation. Between the two bullets there isn't apparently any difference: At the end of the line with the bullet there are two spaces, and the new line character.

Adding an empty line between the quoted part of the first point, and the start of the second point renders the quoted part correctly, but why is that empty line necessary?

screenshot

share|improve this question
    
The answer I am referring in the question is the this one. –  kiamlaluno Apr 28 '12 at 13:06
add comment

1 Answer

up vote 6 down vote accepted

I never figured out the precise why in cases like this. But I feel blank lines are part of the Markdown philosophy to make things readable in plain text. Hence it's fine with me that Markdown sometimes needs blank lines to consider changing the type of thing it's rendering. Like the following will nicely render as a single quote block (not two), just like I expect it to:

> How about the "X" sign representing a
> kiss? [...]

Not using blank lines to surround such blocks might yield unexpected results (well, for the editor), like you're seeing.

Note that in your example it's not the second item that is rendered differently from the first, but the first is different from the others, probably as it has a blank line above it, which the others don't. Next, you were also trying to use double-spaces at the end of some lines to get an explicit line break (which should rarely be needed), which probably complicates things too. Without those, your example with a numbered list:

1. How Valentine's Day Works
> How about the "X" sign representing a
> kiss? [...]
3. Why Does X Stand for a Kiss?
> However, the prosaic explanation of this
> romantic sign may be twofold. [...]
15. Online Etymology Dictionary
> As a symbol of a kiss on a letter, etc.,
> it is recorded from 1765.

...has many different results in the many implementations, and on Stack Exchange renders as:

  1. How Valentine's Day Works

    How about the "X" sign representing a kiss? [...]

  2. Why Does X Stand for a Kiss? However, the prosaic explanation of this romantic sign may be twofold. [...]
  3. Online Etymology Dictionary As a symbol of a kiss on a letter, etc., it is recorded from 1765.
(This currently even messes up things that come after it: if at this very point I add a blank line, then the links in the next paragraph are no longer parsed...!) Above, your first quote is still part of the list; when using numbers like above the second item is numbered "2" by the browser. That's probably what you wanted, but not what you'd get when adding blank lines. When using the blank lines (source), the quotes break the list numbering. These are actually three lists then:

  1. How Valentine's Day Works

How about the "X" sign representing a kiss? [...]

  1. Why Does X Stand for a Kiss?

However, the prosaic explanation of this romantic sign may be twofold. [...]

  1. Online Etymology Dictionary

As a symbol of a kiss on a letter, etc., it is recorded from 1765.

In general I'd say: make your Markdown readable by using that whitespace, and the rest will follow. In this case, make things explicit in the plain text by indenting the quotes:

1. How Valentine's Day Works

    > How about the "X" sign representing a
    > kiss? [...]

3. Why Does X Stand for a Kiss?

    > However, the prosaic explanation of this
    > romantic sign may be twofold. [...]

15. Online Etymology Dictionary

    > As a symbol of a kiss on a letter, etc.,
    > it is recorded from 1765.

...which nicely gives you:

  1. How Valentine's Day Works

    How about the "X" sign representing a kiss? [...]

  2. Why Does X Stand for a Kiss?

    However, the prosaic explanation of this romantic sign may be twofold. [...]

  3. Online Etymology Dictionary

    As a symbol of a kiss on a letter, etc., it is recorded from 1765.

That still does not solve all rendering issues with nested items in lists, but well...

share|improve this answer
    
+1: I once tried (for fun) to figure out how Markdown actually comprehends what formatting to apply, based on the documentation and experimentation (i.e., no reading the code) and I gave up. Too many weird side-cases that worked in unexpected ways… –  Donal Fellows Apr 28 '12 at 15:20
    
Indeed, @Donal, see Babelmark to compare the many implementations against one another... –  Arjan Apr 28 '12 at 16:21
add comment

You must log in to answer this question.

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