fix: improve active mark detection for inline nodes, fix #1893

This commit is contained in:
Philipp Kühn 2021-09-15 23:25:28 +02:00
parent 80570e2805
commit 6437790431

View File

@ -30,7 +30,7 @@ export default function isMarkActive(
let markRanges: MarkRange[] = []
state.doc.nodesBetween(from, to, (node, pos) => {
if (node.isText) {
if (node.isText || node.marks.length) {
const relativeFrom = Math.max(from, pos)
const relativeTo = Math.min(to, pos + node.nodeSize)
const range = relativeTo - relativeFrom