Fix edit related bugs (#1477)

* fix missing empty line on edit

* fix edit save after adding formatting to plaintext

* fix reading edit content with wrong key
This commit is contained in:
Ajay Bura 2023-10-23 21:42:27 +11:00 committed by GitHub
parent b80f801d23
commit 1ff312d236
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 15 deletions

View file

@ -138,6 +138,7 @@ const parseBlockquoteNode = (node: Element): BlockQuoteElement => {
}
if (isTag(child)) {
if (child.name === 'br') {
lineHolder.push({ text: '' });
appendLine();
return;
}
@ -202,6 +203,7 @@ const parseListNode = (node: Element): OrderedListElement | UnorderedListElement
}
if (isTag(child)) {
if (child.name === 'br') {
lineHolder.push({ text: '' });
appendLine();
return;
}
@ -260,6 +262,7 @@ export const domToEditorInput = (domNodes: ChildNode[]): Descendant[] => {
}
if (isTag(node)) {
if (node.name === 'br') {
lineHolder.push({ text: '' });
appendLine();
return;
}