mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-11-24 03:42:32 +01:00
fix(wysiwyg): preserves line feeds in code block mode
This commit is contained in:
parent
9d15688a43
commit
049d6ba5b2
@ -136,7 +136,7 @@ function codePlugin() {
|
||||
const selectedNode = editor.selection.getNode();
|
||||
|
||||
if (!elemIsCodeBlock(selectedNode)) {
|
||||
const providedCode = editor.selection.getNode().textContent;
|
||||
const providedCode = editor.selection.getNode().innerText;
|
||||
window.components.first('code-editor').open(providedCode, '', (code, lang) => {
|
||||
const wrap = document.createElement('div');
|
||||
wrap.innerHTML = `<pre><code class="language-${lang}"></code></pre>`;
|
||||
|
Loading…
Reference in New Issue
Block a user