Closed samuelcolvin closed 7 years ago
looks like this might be useful too, but it used the old version of misaka and therefore EXT_LAX_HTML_BLOCKS
which doesn't exist for version 2.x.
Goodmorning Samuel, I'll take a look at it.
EXT_LAX_HTML_BLOCKS
is not available in Hoedown, the parser that Misaka uses. You can use HTML_HARD_WRAP
to insert <br>
on each linebreak.
I had realised that EXT_LAX_HTML_BLOCKS
wasn't available, that's why I was looking for a better solution.
Thanks for pointing out HTML_HARD_WRAP
, very useful.
GFM (github flavoured markdown) is very popular these days. It would be great if there was some help somewhere on how to get misaka to generate GFM.
I know it's never going to be identical but some pointers for the most important features would be useful.
Currently my solution to get something close to GFM's linebreak behavior is:
The regular expression is required since gfm does:
Whereas hoedown and misaka require two spaces before the
\n
to insert the<br />
. I tried overwriting most of the render methods but couldn't find a solution to the above.There are probably other differences (particularly on tables) but newlines are most people's first stumbling block with markdown.
(updated to regex to use lookahead/behinds properly).