From 823b67b1e66e60eee036f6c47015431f11126284 Mon Sep 17 00:00:00 2001 From: chrisarmstrong Date: Wed, 28 Apr 2021 10:05:48 +0100 Subject: [PATCH] Make compatible with Typography extension MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/extension-horizontal-rule/src/horizontal-rule.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/extension-horizontal-rule/src/horizontal-rule.ts b/packages/extension-horizontal-rule/src/horizontal-rule.ts index db93ebdc..680bc275 100644 --- a/packages/extension-horizontal-rule/src/horizontal-rule.ts +++ b/packages/extension-horizontal-rule/src/horizontal-rule.ts @@ -70,7 +70,7 @@ export const HorizontalRule = Node.create({ addInputRules() { return [ - nodeInputRule(/^(?:---|___\s|\*\*\*\s)$/, this.type), + nodeInputRule(/^(?:---|\—-|___\s|\*\*\*\s)$/, this.type), ] }, })