You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using a code block in a doc comment and wrap_comments is enabled, the comment will wrap into the next line making the following code block no longer valid a valid code block.
The syntax reference for rustdoc says that exact syntax is the Fenced Code Blocks section of the CommonMark specification. The CommonMark spec states: "A fenced code block may interrupt a paragraph, and does not require a blank line either before or after."
Example
Initial code:
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
/// ```
/// let foo = 0;
/// ```
fn bar() {}
Result:
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
/// lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam ```
/// let foo = 0;
/// ```
Expected:
/// Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam
/// lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam
/// ```
/// let foo = 0;
/// ```
The text was updated successfully, but these errors were encountered:
grant0417
changed the title
wrap_line overflows into codeblock fencewrap_comments overflows into codeblock fence
Dec 12, 2024
When using a code block in a doc comment and
wrap_comments
is enabled, the comment will wrap into the next line making the following code block no longer valid a valid code block.The syntax reference for rustdoc says that exact syntax is the Fenced Code Blocks section of the CommonMark specification. The CommonMark spec states: "A fenced code block may interrupt a paragraph, and does not require a blank line either before or after."
Example
Initial code:
Result:
Expected:
The text was updated successfully, but these errors were encountered: