]> BookStack Code Mirror - bookstack/blobdiff - resources/js/wysiwyg/lexical/rich-text/LexicalCodeBlockNode.ts
Lexical: Fixed code in lists, removed extra old alignment code
[bookstack] / resources / js / wysiwyg / lexical / rich-text / LexicalCodeBlockNode.ts
index cbe6918488724dcf59bd5fa6b7b06d7d2c260edc..49ba7754c4c7d541a84fa68ef768785c1c5c21fb 100644 (file)
@@ -145,7 +145,14 @@ export class CodeBlockNode extends DecoratorNode<EditorDecoratorAdapter> {
                             node.setId(element.id);
                         }
 
-                        return { node };
+                        return {
+                            node,
+                            after(childNodes): LexicalNode[] {
+                                // Remove any child nodes that may get parsed since we're manually
+                                // controlling the code contents.
+                                return [];
+                            },
+                        };
                     },
                     priority: 3,
                 };