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

Line breaks inside tag #217

Open
multiwebinc opened this issue Nov 18, 2021 · 3 comments
Open

Line breaks inside tag #217

multiwebinc opened this issue Nov 18, 2021 · 3 comments

Comments

@multiwebinc
Copy link
Contributor

Version(s) affected

5.0.2

Description

Line breaks inside tags produce incorrect markdown

How to reproduce

HTML:

<b>Hello<br><br>World</b>

Output:

**Hello  
  
world**

Expected output:

**Hello**
  
**world**
@colinodell
Copy link
Member

colinodell commented Nov 19, 2021

This is an interesting case that could have three possible desired outputs based on one's philosophy of how this library should work.

You've already illustrated one case, where you expect the library to produce Markdown that, if converted back to HTML, produces results that are visually similar to users but with different HTML:

<p><strong>Hello</strong></p>
<p><strong>World</strong></p>

Another philosophy would be that this library should strive to produce Markdown like this:

**Hello<br><br>World**

Which converts back into virtually-identical HTML like this:

<p><strong>Hello<br><br>World</strong</p>

(That is the approach that I personally prefer)

Lastly, there's a third philosophy that's kind of a hybrid of the two which would give Markdown like this:

**Hello\
\
World**

This produces:

<p><strong>Hello<br />
<br />
world</strong></p>

But I don't think that's something anyone would really want or expect :)

Regardless, I agree that this is a bug.

@stale
Copy link

stale bot commented Mar 2, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Mar 2, 2022
@stale stale bot closed this as completed Apr 18, 2022
@multiwebinc
Copy link
Contributor Author

This should probably be reopened.

@colinodell colinodell reopened this Apr 19, 2022
@stale stale bot removed the stale label Apr 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants