File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -319,6 +319,7 @@ fn rewrite_comment_inner(
319
319
320
320
let mut result = opener. to_owned ( ) ;
321
321
let mut is_prev_line_multi_line = false ;
322
+ let mut inside_code_block = false ;
322
323
let comment_line_separator = format ! ( "\n {}{}" , indent_str, line_start) ;
323
324
for line in lines {
324
325
if result == opener {
@@ -331,6 +332,14 @@ fn rewrite_comment_inner(
331
332
result. push_str ( & comment_line_separator) ;
332
333
}
333
334
335
+ if line. starts_with ( "```" ) {
336
+ inside_code_block = !inside_code_block;
337
+ }
338
+ if inside_code_block {
339
+ result. push_str ( line) ;
340
+ continue ;
341
+ }
342
+
334
343
if config. wrap_comments ( ) && line. len ( ) > fmt. shape . width && !has_url ( line) {
335
344
match rewrite_string ( line, & fmt, Some ( max_chars) ) {
336
345
Some ( ref s) => {
You can’t perform that action at this time.
0 commit comments