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

Lines wrap incorrectly when followed by a non-wrappable line #227

Closed
edwardloveall opened this issue Jul 5, 2022 · 2 comments · Fixed by #228
Closed

Lines wrap incorrectly when followed by a non-wrappable line #227

edwardloveall opened this issue Jul 5, 2022 · 2 comments · Fixed by #228

Comments

@edwardloveall
Copy link
Contributor

edwardloveall commented Jul 5, 2022

Hello! I believe I've found a bug. I have a markdown file untitled.md:

item that doesn't need wrapping

a-long-line-that-won't-be-wrapped-because-there-is-no-character-it-can-break-on

When running this through the cli with the --to commonmark and --width 72 options:

comrak --to commonmark --width 72 untitled.md

It outputs the following:

item that doesn't need
wrapping

a-long-line-that-won't-be-wrapped-because-there-is-no-character-it-can-break-on

I think the list item is not supposed to wrap there. If the last line is short enough to not need wrapping, this doesn't occur. If the last line is wrappable (e.g. remove all the - characters), this also doesn't occur.

@kivikakk
Copy link
Owner

kivikakk commented Jul 6, 2022

Thanks for this report — verified. Will look into a fix in a little bit.

Also, if you felt like giving it a go yourself and had the time, please feel free! Should be a nice easy one to just compare the wrapping behaviour of comrak's CommonMark formatter and cmark-gfm's.

@edwardloveall edwardloveall changed the title List items wrap incorrectly when followed by a non-wrappable line Lines wrap incorrectly when followed by a non-wrappable line Jul 6, 2022
@edwardloveall
Copy link
Contributor Author

Cool. I made an attempt at a fix in #228

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

Successfully merging a pull request may close this issue.

2 participants