mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-08-26 20:22:18 +00: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();
|
const selectedNode = editor.selection.getNode();
|
||||||
|
|
||||||
if (!elemIsCodeBlock(selectedNode)) {
|
if (!elemIsCodeBlock(selectedNode)) {
|
||||||
const providedCode = editor.selection.getNode().textContent;
|
const providedCode = editor.selection.getNode().innerText;
|
||||||
window.components.first('code-editor').open(providedCode, '', (code, lang) => {
|
window.components.first('code-editor').open(providedCode, '', (code, lang) => {
|
||||||
const wrap = document.createElement('div');
|
const wrap = document.createElement('div');
|
||||||
wrap.innerHTML = `<pre><code class="language-${lang}"></code></pre>`;
|
wrap.innerHTML = `<pre><code class="language-${lang}"></code></pre>`;
|
||||||
|
Loading…
Reference in New Issue
Block a user