Cocoanetics / DTMarkdownParser

An event-based parser for markdown text
BSD 2-Clause "Simplified" License
197 stars 15 forks source link

Parser emits BR between lines where a newline should go. #6

Closed JanX2 closed 10 years ago

JanX2 commented 10 years ago

https://github.com/JanX2/google-diff-match-patch-Objective-C/blob/master/README.markdown

odrobnik commented 10 years ago

The reason for this is that you have enabled GitHub Break Mode which puts a BR for every \n. But this should not occur inside the visible text of a hyperlink.

for example, the following:

-   [Patch
    Demo](http://neil.fraser.name/software/diff_match_patch/svn/trunk/demos/demo_patch.html)

I will remove newlines inside of hyperlink text.

odrobnik commented 10 years ago

Turns out that this is harder than I thought. Right now I have two parsing loops. The outer goes line by line and this means that it sees only half of the two lines involved in the hyperlink at any given time.

To address that it is necessary to change that to a single scanner and scan loop.

odrobnik commented 10 years ago

implemented. I changed the parsing to be no longer (entirely) line-based.