Skip to content

wrap_comments = true breaks markdown tables #4210

@WaffleLapkin

Description

@WaffleLapkin

cargo fmt -- --config wrap_comments=true turns this:

/// doc
///
/// Table that is > 80 symbols:
///
/// | table | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx |
/// |-------|--------------------------------------------------------------------|
/// | val   | x                                                                  |
struct Item;

image

Into this:

/// doc
///
/// Table that is > 80 symbols:
///
/// | table | xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
/// |
/// |-------|--------------------------------------------------------------------|
/// | val   | x
/// |
struct Item;

image

It's possible to work around this issue by adding #[rustfmt::skip] to the struct (or other documented item), but I think it's a bug anyway.

Metadata

Metadata

Assignees

No one assigned

    Labels

    1x-backport:pendingFixed/resolved in source but not yet backported to a 1x branch and releaseC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEonly-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