mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-08-06 12:02:45 +03:00
Lexical: Source code input changes
- Increased default source code view size. - Updated HTML generation to output each top-level block on its own line.
This commit is contained in:
@@ -85,7 +85,18 @@ export function $generateHtmlFromNodes(
|
||||
$appendNodesToHTML(editor, topLevelNode, container, selection);
|
||||
}
|
||||
|
||||
return container.innerHTML;
|
||||
const nodeCode = [];
|
||||
for (const node of container.childNodes) {
|
||||
if ("outerHTML" in node) {
|
||||
nodeCode.push(node.outerHTML)
|
||||
} else {
|
||||
const wrap = document.createElement('div');
|
||||
wrap.appendChild(node.cloneNode(true));
|
||||
nodeCode.push(wrap.innerHTML);
|
||||
}
|
||||
}
|
||||
|
||||
return nodeCode.join('\n');
|
||||
}
|
||||
|
||||
function $appendNodesToHTML(
|
||||
|
Reference in New Issue
Block a user