Skip to content

Parse markdown without trimming spaces #1194

Answered by wooorm
fgarcia asked this question in Q&A
Discussion options

You must be logged in to vote

detect quick outlines

What do you mean detect? What are “quick outlines”?

Sadly the parser trims the leading spaces. So I get this (no empty space after \n)

This is how markdown works. Leading and trailing spaces are dropped.

Somehow I can circumvent this adding a non significant empty space to the text before parsing

this is also how markdown works. Leading and trailing spaces are dropped, but other spaces are not, meaning between non-space character. A   (non-breaking space) is such a character.

Basically I want a simple syntax extension where the leading white space has some meaning. Is there a way to prevent auto-trimming in the mdast?

That isn’t markdown. It doesn’t work…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@fgarcia
Comment options

@ChristianMurphy
Comment options

Answer selected by fgarcia
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