Skip to content

displaying multiline text with markdown #198

Answered by mad-moo
Nachsh asked this question in Q&A
Discussion options

You must be logged in to vote

Hey!

What you're seeing is just standard markdown behavior. An example should clear this up:

Linebreaks are ignored in markdown. For example, even though this text spans
two lines, it is displayed as a single one in the final output.

To force a linebreak, markdown requires you to leave a completely empty line.
Notice how due to the empty line above the text is displayed as two paragraphs.

Above text as rendered by markdown ^^^

While we're at it, another common gotcha is that indented code is rendered as code block in markdown. So if generating a string in Python, make sure you don't have a bunch of spaces at the start of it.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Nachsh
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants