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

Prevent wrapping markdown headers in doc comments #5242

Merged
merged 1 commit into from
Mar 1, 2022

Conversation

ytmimi
Copy link
Contributor

@ytmimi ytmimi commented Feb 25, 2022

Fixes #5238

A markdown header is defined by a string that starts with #.

Previously, rustfmt would wrap long markdown headers when
wrap_comments=true. This lead to issues when rendering these headers
in HTML using rustdoc.

Now, rustfmt leaves markdown headers alone when wrapping comments.

Fixes 5238

A markdown header is defined by a string that starts with `#`.

Previously, rustfmt would wrap long markdown headers when
`wrap_comments=true`. This lead to issues when rendering these headers
in HTML using rustdoc.

Now, rustfmt leaves markdown headers alone when wrapping comments.
Copy link
Member

@calebcartwright calebcartwright left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent, ty!

@calebcartwright calebcartwright merged commit 272fb42 into rust-lang:master Mar 1, 2022
@ytmimi ytmimi deleted the issue_5238 branch August 7, 2022 15:34
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.

wrap_comments wraps (long) headers
2 participants