diff --git a/packages/core/src/inputRules/markInputRule.ts b/packages/core/src/inputRules/markInputRule.ts index 376813fe1..7f56d1c66 100644 --- a/packages/core/src/inputRules/markInputRule.ts +++ b/packages/core/src/inputRules/markInputRule.ts @@ -51,12 +51,12 @@ export default function (regexp: RegExp, markType: MarkType, getAttributes?: Fun } markEnd = start + startSpaces + captureGroup.length + + tr.addMark(start + startSpaces, markEnd, markType.create(attributes)) + + tr.removeStoredMark(markType) } - tr.addMark(start, markEnd, markType.create(attributes)) - - tr.removeStoredMark(markType) - return tr }) }