mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-30 04:23:11 +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:
@ -11,7 +11,6 @@ import type {
|
||||
DOMChildConversion,
|
||||
DOMConversion,
|
||||
DOMConversionFn,
|
||||
ElementFormatType,
|
||||
LexicalEditor,
|
||||
LexicalNode,
|
||||
} from 'lexical';
|
||||
@ -58,6 +57,7 @@ export function $generateNodesFromDOM(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$unwrapArtificalNodes(allArtificialNodes);
|
||||
|
||||
return lexicalNodes;
|
||||
@ -324,8 +324,6 @@ function wrapContinuousInlines(
|
||||
nodes: Array<LexicalNode>,
|
||||
createWrapperFn: () => ElementNode,
|
||||
): Array<LexicalNode> {
|
||||
const textAlign = (domNode as HTMLElement).style
|
||||
.textAlign as ElementFormatType;
|
||||
const out: Array<LexicalNode> = [];
|
||||
let continuousInlines: Array<LexicalNode> = [];
|
||||
// wrap contiguous inline child nodes in para
|
||||
|
Reference in New Issue
Block a user