AttributedMarkdown icon indicating copy to clipboard operation
AttributedMarkdown copied to clipboard

Are newlines handled correctly?

Open georgbachmann opened this issue 9 years ago • 2 comments

I am not sure if newlines are handled correctly... Would like to know if it really is an issue with the library or if it's just me not knowing enough about markdown.

I have the following input

*italics*
**bold**
***bold italic***

And what I get is

italics bold _bold italic_

instead of:

italics bold _bold italic_

What would be the correct behaviour? And could I get my expected behaviour new lines using this library?

Thanks, Georg

georgbachmann avatar Sep 02 '15 13:09 georgbachmann

I had the same issue, explored it pretty thoroughly. Might be an issue with the underlying raw parser which appears to be autogenerated C code from another language. Seems like single newlines never bubble up as newline nodes. Two newlines in a row are handled properly as a new paragraph, though.

indragiek/CocoaMarkdown, though in beta, looks promising; based on jgm/cmark CommonMark implementation. Does not build for me though, as of the time of this writing.

Jiropole avatar Oct 20 '15 00:10 Jiropole

This is common behavior in markdown. Even on github, when parsing a markdown file like Readme.md. Two newlines make a paragraph. Single newlines are collapsed to a single space character.

colllin avatar Nov 12 '15 02:11 colllin