Skip to content

Commit

Permalink
remove unused let in mark input rules (#4162)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mcshaz committed Jul 7, 2023
1 parent 9ddef25 commit 18946b1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/core/src/inputRules/markInputRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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/)
Expand Down Expand Up @@ -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 || {}))

Expand Down

0 comments on commit 18946b1

Please sign in to comment.