fix calculating mark range for unsetMark command

This commit is contained in:
Philipp Kühn 2021-09-08 12:02:43 +02:00
parent 472f2139c5
commit a5dca087ee

View File

@ -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