feat: allow wildcards when checking attributes in isActive, fix #1752

This commit is contained in:
Philipp Kühn
2021-08-20 10:51:46 +02:00
parent c473f550c7
commit 64409cad66
5 changed files with 149 additions and 8 deletions

View File

@@ -23,7 +23,7 @@ export default function isMarkActive(
return type.name === mark.type.name
})
.find(mark => objectIncludes(mark.attrs, attributes))
.find(mark => objectIncludes(mark.attrs, attributes, { strict: false }))
}
let selectionRange = 0
@@ -58,7 +58,7 @@ export default function isMarkActive(
return type.name === markRange.mark.type.name
})
.filter(markRange => objectIncludes(markRange.mark.attrs, attributes))
.filter(markRange => objectIncludes(markRange.mark.attrs, attributes, { strict: false }))
.reduce((sum, markRange) => {
const size = markRange.to - markRange.from