From a75a3593190a840f7dafaba38ecbc5cb247230b4 Mon Sep 17 00:00:00 2001 From: Brent McSharry <2456704+mcshaz@users.noreply.github.com> Date: Tue, 27 Jun 2023 09:35:03 +1200 Subject: [PATCH] Update markInputRule.ts trivial change - the markEnd variable was assigned outside the block and then reassigned within the block without ever using the initial value. Using const assignment just above the first use of the variable improves readability. --- packages/core/src/inputRules/markInputRule.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/core/src/inputRules/markInputRule.ts b/packages/core/src/inputRules/markInputRule.ts index 896008756ad..72fd27b8b1a 100644 --- a/packages/core/src/inputRules/markInputRule.ts +++ b/packages/core/src/inputRules/markInputRule.ts @@ -30,7 +30,6 @@ export function markInputRule(config: { const { tr } = state const captureGroup = match[match.length - 1] const fullMatch = match[0] - let markEnd = range.to if (captureGroup) { const startSpaces = fullMatch.search(/\S/) @@ -58,7 +57,7 @@ export function markInputRule(config: { tr.delete(range.from + startSpaces, textStart) } - markEnd = range.from + startSpaces + captureGroup.length + const markEnd = range.from + startSpaces + captureGroup.length tr.addMark(range.from + startSpaces, markEnd, config.type.create(attributes || {}))