Skip to content

Commit 61b065a

Browse files
committed
fix(commands): magic split: add case with ordered lists in 1.2 style (no dot in the end)
1 parent 5c4d09a commit 61b065a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/commands/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ export function magicSplit(text: string): IBatchBlock[] {
400400
text = text.replaceAll(/^(\s*)\((\d{1,3}\)\s)/gm, '$1$2')
401401
// 1.2.3. → 1)
402402
text = text.replaceAll(/^(\s*)((\d|\p{Lowercase_Letter}){1,3}\.){2,10}\s/gmiu, '$11) ') // $11 means $1 and 1
403+
// 1.2.3 → 1)
404+
text = text.replaceAll(/^(\s*)((\d|\p{Lowercase_Letter}){1,3}\.){1,10}(\d|\p{Lowercase_Letter}){1,3}\s/gmiu, '$11) ') // $11 means $1 and 1
403405
// (1.2.3) → 1) and 1.2.3) → 1)
404406
text = text.replaceAll(/^(\s*)\(?((\d|\p{Lowercase_Letter}){1,3}\.){1,10}(\d|\p{Lowercase_Letter}){1,3}\)\s/gmiu, '$11) ')
405407
// a) → 1) and (a) → 1)

0 commit comments

Comments
 (0)