Skip to content

Commit

Permalink
fix: Ordered list start support broke in #3541 (#3833)
Browse files Browse the repository at this point in the history
* fix: #3831

* fix: default attribute + predicate
  • Loading branch information
gethari authored Mar 18, 2023
1 parent 928bd36 commit 3937c44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/extension-ordered-list/src/ordered-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ export const OrderedList = Node.create<OrderedListOptions>({
let inputRule = wrappingInputRule({
find: inputRegex,
type: this.type,
getAttributes: match => ({ start: +match[1] }),
joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],
})

if (this.options.keepMarks || this.options.keepAttributes) {
Expand All @@ -99,7 +101,8 @@ export const OrderedList = Node.create<OrderedListOptions>({
type: this.type,
keepMarks: this.options.keepMarks,
keepAttributes: this.options.keepAttributes,
getAttributes: () => { return this.editor.getAttributes(TextStyle.name) },
getAttributes: match => ({ start: +match[1], ...this.editor.getAttributes(TextStyle.name) }),
joinPredicate: (match, node) => node.childCount + node.attrs.start === +match[1],
editor: this.editor,
})
}
Expand Down

0 comments on commit 3937c44

Please sign in to comment.