Merge branch 'main' of github.com:ueberdosis/tiptap-next into main

This commit is contained in:
Hans Pagel
2020-12-02 15:35:52 +01:00
4 changed files with 72 additions and 30 deletions

View File

@@ -36,7 +36,7 @@ export default function isMarkActive(
let markRanges: MarkRange[] = []
state.doc.nodesBetween(from, to, (node, pos) => {
if (node.isInline) {
if (node.isText) {
const relativeFrom = Math.max(from, pos)
const relativeTo = Math.min(to, pos + node.nodeSize)
const range = relativeTo - relativeFrom
@@ -51,6 +51,10 @@ export default function isMarkActive(
}
})
if (selectionRange === 0) {
return false
}
const range = markRanges
.filter(markRange => {
if (!type) {