Make compatible with Typography extension

They Typography extension automatically converts two hyphens `--` into an em dash `–`, which means typing three hyphens in a row results in an em dash and a hyphen `–-`, instead of triggering an hr. 

I propose adding the `–-` pattern to this `nodeInputRule` so typing three hyphens in a row will still trigger an hr, even if 'smart dashes' are enabled via the Typography extension or otherwise.
This commit is contained in:
chrisarmstrong
2021-04-28 10:05:48 +01:00
committed by GitHub
parent 8393342b19
commit 823b67b1e6

View File

@@ -70,7 +70,7 @@ export const HorizontalRule = Node.create<HorizontalRuleOptions>({
addInputRules() {
return [
nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/, this.type),
nodeInputRule(/^(?:---|\—-|___\s|\*\*\*\s)$/, this.type),
]
},
})