yogthos/markdown-clj

Newlines inside anchors does not work

cjohansen opened this issue · 5 comments

If you have a newline in the link text of a markdown link, the parser spits it out verbatim:

[Here is a long
link text](/page)

This is rendered as is in HTML.

that's actually documented limitation at the moment https://github.com/yogthos/markdown-clj#limitations

I see. Would you be interested in a PR to fix it? It seems to me that parsing paragraph by paragraph would solve both this and my other issue?

Sure, a PR would be most welcome.

Ok, I'll see what I find the time for :) I have lots of markdown files, and fixing the issue would probably be easier than looking over the files... But I don't know anything about the implementation, so maybe I'm wrong :)

It shouldn't be too bad to fix in theory. You'd basically just want to preprocess the input to read contiguous chunks instead of single lines. Also, you might want to take a look at using flexmark instead. Here's an example calling it from Clojure.