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

markdown: really fix soft line break rendering #95

Merged
merged 1 commit into from
Mar 28, 2023
Merged

Conversation

unknwon
Copy link
Member

@unknwon unknwon commented Mar 28, 2023

#92 wasn't a good fix, now for real.

CleanShot 2023-03-28 at 17 13 22@2x

@unknwon unknwon requested review from sqs and vdavid March 28, 2023 09:12
@unknwon
Copy link
Member Author

unknwon commented Mar 28, 2023

Merging as-is, happy to address any post-merge comments!

@unknwon unknwon merged commit a1bbaa9 into main Mar 28, 2023
@unknwon unknwon deleted the jc/soft-breaks branch March 28, 2023 09:14
@sanderginn
Copy link

Please correct me if I'm wrong but shouldn't a space be inserted instead of a newline? To me it seems like the markdown pages that contain line breaks mid sentence are the result of some IDE formatting rule setting a max column width, not because the author actually wanted to insert a newline at that specific location.

@unknwon
Copy link
Member Author

unknwon commented Mar 28, 2023

Please correct me if I'm wrong but shouldn't a space be inserted instead of a newline? To me it seems like the markdown pages that contain line breaks mid sentence are the result of some IDE formatting rule setting a max column width, not because the author actually wanted to insert a newline at that specific location.

Browser renders the \n as a space in the HTML version. You made a good point, not sure why renders I've seen (not just goldmark) aren't doing that though (maybe a literal space has some pitfalls?). I looked very hard at how the goldmark's builtin render handles the soft line breaks, which uses \n as well.

@sanderginn
Copy link

Fair enough! Thanks for the explanation 🙂

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