mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-07 17:43:49 +08:00
fix: allow to re-apply current mark for input rules and paste rules, fix #2003
This commit is contained in:
parent
3a7e202e71
commit
3958bf1c22
@ -39,11 +39,10 @@ export default function markInputRule(config: {
|
||||
|
||||
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
||||
.filter(item => {
|
||||
// TODO: PR to add excluded to MarkType
|
||||
// @ts-ignore
|
||||
const { excluded } = item.mark.type
|
||||
const excluded = item.mark.type.excluded as MarkType[]
|
||||
|
||||
return excluded.find((type: MarkType) => type.name === config.type.name)
|
||||
return excluded.find(type => type === config.type && type !== item.mark.type)
|
||||
})
|
||||
.filter(item => item.to > textStart)
|
||||
|
||||
|
@ -39,11 +39,10 @@ export default function markPasteRule(config: {
|
||||
|
||||
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
||||
.filter(item => {
|
||||
// TODO: PR to add excluded to MarkType
|
||||
// @ts-ignore
|
||||
const { excluded } = item.mark.type
|
||||
const excluded = item.mark.type.excluded as MarkType[]
|
||||
|
||||
return excluded.find((type: MarkType) => type.name === config.type.name)
|
||||
return excluded.find(type => type === config.type && type !== item.mark.type)
|
||||
})
|
||||
.filter(item => item.to > textStart)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user