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

wrap_comments does not ensure code blocks start on a new line #5244

Open
imlazyeye opened this issue Feb 28, 2022 · 1 comment · May be fixed by #5267 or #6417
Open

wrap_comments does not ensure code blocks start on a new line #5244

imlazyeye opened this issue Feb 28, 2022 · 1 comment · May be fixed by #5267 or #6417
Labels
a-comments a-markdown markdown formatting in doc comments only-with-option requires a non-default option value to reproduce

Comments

@imlazyeye
Copy link

When a long line in a comment is followed by a code block, rustfmt may break the formatting on the code block.

Configuration

edition = "2021"
wrap_comments = true
unstable_features = true

Input

/// Here is me writing some documentation that is too long oh me oh my now some code please!
/// ```
/// test
/// ```
fn foo() {}

Output

/// Here is me writing some documentation that is too long oh me oh my now some
/// code please! ```
/// test
/// ```
fn foo() {}

Expected

/// Here is me writing some documentation that is too long oh me oh my now some
/// code please! 
/// ```
/// test
/// ```
fn foo() {}
@ytmimi
Copy link
Contributor

ytmimi commented Feb 28, 2022

Thanks for submitting this report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a-comments a-markdown markdown formatting in doc comments only-with-option requires a non-default option value to reproduce
Projects
None yet
2 participants