Skip to content

Commit

Permalink
fix calculating mark range for unsetMark command
Browse files Browse the repository at this point in the history
  • Loading branch information
philippkuehn committed Sep 8, 2021
1 parent 472f213 commit a5dca08
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/commands/unsetMark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ export const unsetMark: RawCommands['unsetMark'] = (typeOrName, options = {}) =>

if (empty && extendEmptyMarkRange) {
let { from, to } = selection
const range = getMarkRange($from, type)
const attrs = selection.$from.marks().find(mark => mark.type === type)?.attrs
const range = getMarkRange($from, type, attrs)

if (range) {
from = range.from
Expand Down

0 comments on commit a5dca08

Please sign in to comment.