refactor(copilot): simplify ghost mark addition by removing conditional check
Remove the mark type allowance validation and apply ghost marks directly to text nodes within the specified range.
This commit is contained in:
@@ -149,10 +149,7 @@ function addGhostMarksToTextNodes(tr: any, from: number, to: number, markType: a
|
||||
const end = Math.min(pos + node.nodeSize, to)
|
||||
if (end <= start) return true
|
||||
|
||||
const $pos = tr.doc.resolve(start)
|
||||
if ($pos.parent.type.allowsMarkType?.(markType)) {
|
||||
tr.addMark(start, end, markType.create())
|
||||
}
|
||||
return true
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user