Skip to content

Commit 2438b09

Browse files
committed
fix corner case
1 parent 834a3bc commit 2438b09

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ci/sembr/src/main.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
177177
let Some(next_line) = content.get(n + 1) else {
178178
continue;
179179
};
180+
if next_line.trim_start().starts_with("```") {
181+
continue;
182+
}
180183
if ignore(next_line, in_code_block)
181184
|| REGEX_LIST_ENTRY.is_match(next_line)
182185
|| REGEX_IGNORE_END.is_match(line)
@@ -255,6 +258,12 @@ preserve next line
255258
256259
preserve next line
257260
* three
261+
262+
do not mess with code block chars
263+
```
264+
leave the
265+
text alone
266+
```
258267
";
259268
let expected = "\
260269
do not split short sentences
@@ -269,6 +278,12 @@ preserve next line
269278
270279
preserve next line
271280
* three
281+
282+
do not mess with code block chars
283+
```
284+
leave the
285+
text alone
286+
```
272287
";
273288
assert_eq!(expected, lengthen_lines(original, 50));
274289
}

0 commit comments

Comments
 (0)