diff --git a/app/assets/javascripts/02-editor.js b/app/assets/javascripts/02-editor.js index 746141cc..79d09f96 100644 --- a/app/assets/javascripts/02-editor.js +++ b/app/assets/javascripts/02-editor.js @@ -279,13 +279,9 @@ function cleanContent (contentEl) { child.tagName = "P" } } else if (child.nodeType === Node.TEXT_NODE) { - const wasSelected = sel.getRangeAt(0).intersectsNode(child) - const el = document.createElement("p") - el.appendChild(child) contentEl.insertBefore(el, child.nextSibling) - - if (wasSelected) sel.collapse(el, child.data.length) + el.appendChild(child) } } }