cebe / markdown

A super fast, highly extensible markdown parser for PHP
http://markdown.cebe.cc/
MIT License
998 stars 141 forks source link

GFM: Line break using a backslash #169

Open ArthaTi opened 5 years ago

ArthaTi commented 5 years ago

The GFM spec specifies that to make a line break, a backslash can be used so it is more visible. It also better because some editors automatically remove trailing whitespace.

The GithubMarkdown class doesn't support those. Only double-space breaks are allowed. It would be really nice if that feature would be added.

I tried doing this myself, but renderText receives line text and the backslash as separate blocks, so I kinda failed there. Also, what would be the preferred way to do this? Is changing the escape code parser necessary?

cebe commented 5 years ago

The GithubMarkdown class doesn't support those. Only double-space breaks are allowed. It would be really nice if that feature would be added.

seems it is a newly added feature.

https://github.com/cebe/markdown/blob/eeb1bf622e80f337479e00a5db94c56e7cf1326b/Parser.php#L368-L378

have not checked it in detail though.