Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect handling of line breaks #70

Open
philtre opened this issue Apr 14, 2018 · 1 comment
Open

Incorrect handling of line breaks #70

philtre opened this issue Apr 14, 2018 · 1 comment

Comments

@philtre
Copy link

philtre commented Apr 14, 2018

In Markdown, paragraphs are separated by two line breaks. Two spaces at the end of a line produces a newline (or rather a <br /> tag in HTML)
For example (I've replaced spaces with • for clarity):

First•paragraph,•first•line.
First•paragraph,•still•first•line.

Second•paragraph,•first•line.••
Second•paragraph,•second•line.

The expected output is:

<p>First•paragraph,•first•line.
First•paragraph,•still•first•line.</p>

<p>Second•paragraph,•first•line.<br />
Second•paragraph,•second•line.</p>

The output produced by TSMarkdownParser is something more like:

<p>First•paragraph,•first•line.</p>
<p>First•paragraph,•still•first•line.</p>
<p></p>
<p>Second•paragraph,•first•line.</p>
<p>Second•paragraph,•second•line.</p>
@klausbussekw
Copy link

Actually I find the attributed string output much more consistent with user expectations. Beside Swifty this is the only Markdown parser that can handle double breaks (others that I've tested always collapse hem to one).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants