Skip to content

Commit 600a5e3

Browse files
committed
handle another edge case
1 parent 3ac04e5 commit 600a5e3

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

ci/sembr/src/main.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ fn lengthen_lines(content: &str, limit: usize) -> String {
177177
let Some(next_line) = content.get(n + 1) else {
178178
continue;
179179
};
180-
if ignore(next_line, in_code_block) || REGEX_IGNORE_END.is_match(line) {
180+
if ignore(next_line, in_code_block)
181+
|| REGEX_LIST_ENTRY.is_match(next_line)
182+
|| REGEX_IGNORE_END.is_match(line)
183+
{
181184
continue;
182185
}
183186
if line.len() + next_line.len() < limit {
@@ -244,12 +247,28 @@ short sentences
244247
<div class='warning'>
245248
a bit of text inside
246249
</div>
250+
preserve next line
251+
1. one
252+
253+
preserve next line
254+
- two
255+
256+
preserve next line
257+
* three
247258
";
248259
let expected = "\
249260
do not split short sentences
250261
<div class='warning'>
251262
a bit of text inside
252263
</div>
264+
preserve next line
265+
1. one
266+
267+
preserve next line
268+
- two
269+
270+
preserve next line
271+
* three
253272
";
254273
assert_eq!(expected, lengthen_lines(original, 50));
255274
}

0 commit comments

Comments
 (0)