mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 23:15:15 +08:00
fix: only start at block with removing if not an inline node (#4791)
Co-authored-by: Pepijn Hillemans <pepijn.hillemans@cm.com>
This commit is contained in:
parent
7213843951
commit
fb2b1c0b02
@ -57,7 +57,9 @@ export function nodeInputRule(config: {
|
||||
// insert node from input rule
|
||||
tr.replaceWith(matchStart, end, newNode)
|
||||
} else if (match[0]) {
|
||||
tr.insert(start - 1, config.type.create(attributes)).delete(
|
||||
const insertionStart = config.type.isInline ? start : start - 1
|
||||
|
||||
tr.insert(insertionStart, config.type.create(attributes)).delete(
|
||||
tr.mapping.map(start),
|
||||
tr.mapping.map(end),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user