fix: allow to re-apply current mark for input rules and paste rules, fix #2003
This commit is contained in:
@@ -39,11 +39,10 @@ export default function markInputRule(config: {
|
|||||||
|
|
||||||
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
||||||
.filter(item => {
|
.filter(item => {
|
||||||
// TODO: PR to add excluded to MarkType
|
|
||||||
// @ts-ignore
|
// @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)
|
.filter(item => item.to > textStart)
|
||||||
|
|
||||||
|
|||||||
@@ -39,11 +39,10 @@ export default function markPasteRule(config: {
|
|||||||
|
|
||||||
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
const excludedMarks = getMarksBetween(range.from, range.to, state)
|
||||||
.filter(item => {
|
.filter(item => {
|
||||||
// TODO: PR to add excluded to MarkType
|
|
||||||
// @ts-ignore
|
// @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)
|
.filter(item => item.to > textStart)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user