Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,6 +885,9 @@ impl<'a> CommentRewrite<'a> {
// Remove space if this is an empty comment or a doc comment.
self.result.pop();
}
if self.code_block_attr.is_some() && self.is_prev_line_multi_line {
self.result.push_str(&self.comment_line_separator);
}
self.result.push_str(line);
self.fmt.shape = Shape::legacy(self.max_width, self.fmt_indent);
self.is_prev_line_multi_line = false;
Expand Down
7 changes: 7 additions & 0 deletions tests/target/issue-5244/unwrapped.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// rustfmt-wrap_comments: false

/// Here is me writing some documentation that is too long oh me oh my now some code please!
/// ```
/// test
/// ```
fn foo() {}
8 changes: 8 additions & 0 deletions tests/target/issue-5244/wrapped.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// rustfmt-wrap_comments: true

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