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

format failure with non-breaking space #351

Closed
nschloe opened this issue Aug 26, 2022 · 3 comments · Fixed by #352
Closed

format failure with non-breaking space #351

nschloe opened this issue Aug 26, 2022 · 3 comments · Fixed by #352
Labels
bug Something isn't working

Comments

@nschloe
Copy link

nschloe commented Aug 26, 2022

Describe the bug

When running mdformat on

a

 

b

it'll fail. Note the non-breaking space in the middle, i.e.,

"a\n\n\xa0\n\nb"

Reproduce the bug

See above.

List your environment

No response

@nschloe nschloe added the bug Something isn't working label Aug 26, 2022
@hukkin
Copy link
Member

hukkin commented Aug 26, 2022

Thanks for the issue! Let's get this fixed.

In the meanwhile, you can simply remove the NBSP manually. It has no effect on rendered HTML here.

I'm curious to know what you run mdformat against to provide me with these great test cases? 😄

@nschloe
Copy link
Author

nschloe commented Aug 26, 2022

I'm curious to know what you run mdformat against to provide me with these great test cases?

I'm compiling articles from arxiv.org to markdown, and you wouln't believe what constructs you find there. 😄

In the meanwhile, you can simply remove the NBSP manually.

NBSP have a meaning in most cases and I need to preserve them.

@hukkin
Copy link
Member

hukkin commented Aug 26, 2022

Cool!

NBSP have a meaning in most cases and I need to preserve them.

That is correct. But in this particular case all that the NBSP does is it makes an empty <p></p> element which user agents should ignore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants