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

New release 0.7.12 wants 4 spaces infront of <br/> #296

Closed
PhilipMay opened this issue Jan 8, 2022 · 9 comments · Fixed by #297
Closed

New release 0.7.12 wants 4 spaces infront of <br/> #296

PhilipMay opened this issue Jan 8, 2022 · 9 comments · Fixed by #297
Labels
bug Something isn't working

Comments

@PhilipMay
Copy link

Describe the problem

I have a README.md which has something like this:

text
<br/>
text

For some reason the new release of mdformat now wants to add 4 spaces infront of the <br/>.
This breaks all my build pipelines. Since I see no reason why there must be 4 spaces I would say this is a bug.

Could you please patch this and make a patch release?

Many thanks
Philip

Link to your repository or website

https://github.com/telekom/HPOflow/blob/main/README.md

Steps to reproduce

see above

The version of Python you're using

3.9

Your operating system

Linux

Versions of your packages

No response

Additional context

No response

@PhilipMay PhilipMay added the bug Something isn't working label Jan 8, 2022
@welcome
Copy link

welcome bot commented Jan 8, 2022

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.

If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).

Welcome to the EBP community! 🎉

@PhilipMay
Copy link
Author

@hukkin
Copy link
Member

hukkin commented Jan 8, 2022

Ah damn. Thank you very much for the issue!

This change was made to avoid converting inline HTML elements to block HTML. For instance:

text
<div>
text

is very different from

text
    <div>
text

In the former there is a block HTML element and the two "text"s are not in the same paragraph. In the latter there is only one paragraph with an inline HTML element inside.

It seems that the <br/> behaves differently to <div> though. It is never interpreted as block HTML, in contrast to a <div> element, the spaces are not necessary. I've got to read the CommonMark spec a bit.

@hukkin
Copy link
Member

hukkin commented Jan 8, 2022

If there's something positive here, it's that the issue is purely cosmetic and doesn't change rendered HTML in any way.

@PhilipMay
Copy link
Author

If there's something positive here, it's that the issue is purely cosmetic and doesn't change rendered HTML in any way.

Yes, but could you please somehow revert this behavior again?

@hukkin
Copy link
Member

hukkin commented Jan 8, 2022

Yeah I'll try to come up with a fix during the weekend: hopefully a proper one that catches all cases, but if not, at least quick hack that targets this case precisely.

I do recommend using a version pin in CI, as suggested by mdformat docs. Although this is an unintended regression, it is possible some formatting style changes on purpose in the future.

@PhilipMay
Copy link
Author

Thanks!

@PhilipMay
Copy link
Author

I do recommend using a version pin in CI, as suggested by mdformat docs. Although this is an unintended regression, it is possible some formatting style changes on purpose in the future.

Right. But I still want to serve as a regression tester for your cool tool. :-)

@hukkin
Copy link
Member

hukkin commented Jan 8, 2022

Haha, that is an acceptable excuse.

The fix should be released on PyPI as soon as CI is finished here #298

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