Skip to content

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

@imlazyeye

Description

@imlazyeye

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() {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsa-markdownmarkdown formatting in doc commentsonly-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions