formatting

This commit is contained in:
Philipp Kühn
2020-10-28 21:30:50 +01:00
parent a46514468b
commit 12b783c4d2

View File

@@ -2,7 +2,6 @@ import { Plugin } from 'prosemirror-state'
import { Slice, Fragment, MarkType } from 'prosemirror-model' import { Slice, Fragment, MarkType } from 'prosemirror-model'
export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) => any): Plugin { export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any) => any): Plugin {
const handler = (fragment: Fragment, parent?: any) => { const handler = (fragment: Fragment, parent?: any) => {
const nodes: any[] = [] const nodes: any[] = []
@@ -33,7 +32,6 @@ export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any)
// adding the markdown part to nodes // adding the markdown part to nodes
nodes.push(child nodes.push(child
.cut(textStart, textEnd) .cut(textStart, textEnd)
// @ts-ignore
.mark(type.create(attrs).addToSet(child.marks))) .mark(type.create(attrs).addToSet(child.marks)))
pos = matchEnd pos = matchEnd
@@ -59,5 +57,4 @@ export default function (regexp: RegExp, type: MarkType, getAttrs?: (match: any)
}, },
}, },
}) })
} }