Skip to content

Commit a12e879

Browse files
authored
fix: support ordered lists (#61)
* fix: support ordered lists * add actual support
1 parent 10f89b2 commit a12e879

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/markdown-helpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,8 @@ export const safelyJoinTokens = (tokens: Token[], options: JoinTokenOptions = {}
516516
'paragraph_close',
517517
'bullet_list_open',
518518
'bullet_list_close',
519+
'ordered_list_open',
520+
'ordered_list_close',
519521
'list_item_open',
520522
'list_item_close',
521523
'em_open',
@@ -570,13 +572,15 @@ export const safelyJoinTokens = (tokens: Token[], options: JoinTokenOptions = {}
570572
break;
571573
}
572574
case 'bullet_list_open':
575+
case 'ordered_list_open':
573576
// If we are opening a new list inside a list we need to strip a new line from the last close paragraph
574577
if (listLevel > -1) {
575578
joinedContent = joinedContent.slice(0, joinedContent.length - 1);
576579
}
577580
listLevel += 1;
578581
break;
579582
case 'bullet_list_close':
583+
case 'ordered_list_close':
580584
// On close of a nested list, add an extra new line
581585
if (listLevel > -1) {
582586
joinedContent += '\n';

0 commit comments

Comments
 (0)