Skip to content

Fix format ranges spanning newlines #131

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jfschwarz
Copy link
Contributor

@jfschwarz jfschwarz commented Jul 10, 2020

Yet another small edge case bug I found: Italic text spanning a newline does not generate valid markdown.

Example:
image
Currently, this results in markdown like this

fir_st
se_cond

Rendering this will show underscores instead of italic text.

(Interestingly, I just found that GitHub suffers under the very same issue. 😆)

To fix this, we can split all open inline style and entity ranges when hitting a \n character. So now, the markdown produced for this example looks as follows

fir_st_
_se_cond

@Rosey
Copy link
Owner

Rosey commented Jul 17, 2020

In case you're wondering why this is still sitting! I checked it

@Rosey Rosey closed this Jul 17, 2020
@Rosey Rosey reopened this Jul 17, 2020
@Rosey
Copy link
Owner

Rosey commented Jul 17, 2020

Ugh sorry on my phone and hit the "close and comment" button by accident as I was typing my comment 🤪

Anyway: I checked the branch out and was looking at this plus your other pull request and because of the nested loop situation I was going to see if I could make some optimizations before merging. But I haven't actually had a lot of time to dig deeply, thus this PR sits here until I have the chance! 😃

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

Successfully merging this pull request may close these issues.

2 participants