Skip to content

Commit

Permalink
fix(list): use list start number
Browse files Browse the repository at this point in the history
  • Loading branch information
jiawei686 authored and humyfred committed Mar 23, 2022
1 parent 3d7ab86 commit d93b242
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/hooks/InlineMath.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class InlineMath extends ParagraphBase {
}

rule() {
const ret = {
const ret = {
begin: isLookbehindSupported() ? '((?<!\\\\))~D\\n?' : '(^|[^\\\\])~D\\n?',
content: '(.*?)\\n?',
end: '~D',
Expand Down
3 changes: 3 additions & 0 deletions src/core/hooks/List.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,9 @@ export default class List extends ParagraphBase {
attr['data-lines'] = node.index === 0 ? lines + this.emptyLines : lines;
attr['data-sign'] = this.sign;
}
if (children[0] && type === 'ol') {
attr.start = this.tree[children[0]].start;
}
attr.class = `cherry-list__${this.tree[children[0]].listStyle}`;
return `<${type}${attrsToAttributeString(attr)}>${content}</${type}>`;
}
Expand Down

0 comments on commit d93b242

Please sign in to comment.