rustfmt icon indicating copy to clipboard operation
rustfmt copied to clipboard

Ensure code fences are placed on their own line in doc comments

Open ytmimi opened this issue 3 years ago • 0 comments
trafficstars

Fixes #5244

When wrap_comments=true was set there was a chance that the line right before the comment would be wrapped. When this happened, rustfmt didn't place a newline between the wrapped line and the code fence. This placed the start of the code fence on the same line as the previously wrapped line.

Now, rustfmt adds a newline when necessary to ensure that code fences are placed on their own lines.

ytmimi avatar Mar 15 '22 02:03 ytmimi