mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-06 12:02:45 +03:00
Lexical: Fixed code in lists, removed extra old alignment code
Code in lists could throw error on parse due to inner <code> tag being parsed but not actually used within a <pre>, so this updates the importDOM to disregard childdren for code blocks. This also improves the invariant implementation to not be so dev/debugger based, and to include vars in the output.
This commit is contained in:
@@ -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,
|
||||
};
|
||||
|
Reference in New Issue
Block a user