File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/extensions/markdown/Lists Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -26,13 +26,16 @@ export const ListsInputRulesExtension: ExtensionWithOptions<ListsInputRulesOptio
2626
2727/**
2828 * Given a list node type, returns an input rule that turns a number
29- * followed by a dot at the start of a textblock into an ordered list.
29+ * followed by a dot or parenthesis at the start of a textblock into an ordered list.
3030 */
3131export function orderedListRule ( nodeType : NodeType ) {
3232 return wrappingInputRule (
33- / ^ ( \d + ) \. \s $ / ,
33+ / ^ ( \d + ) ( [ . ) ] ) \s $ / ,
3434 nodeType ,
35- ( match ) => ( { [ ListsAttr . Order ] : Number ( match [ 1 ] ) } ) ,
35+ ( match ) => ( {
36+ [ ListsAttr . Order ] : Number ( match [ 1 ] ) ,
37+ [ ListsAttr . Markup ] : match [ 2 ] ,
38+ } ) ,
3639 ( match , node ) => node . childCount + node . attrs [ ListsAttr . Order ] === Number ( match [ 1 ] ) ,
3740 ) ;
3841}
You can’t perform that action at this time.
0 commit comments