From 8887932beee6b106855b520f2645ebf36d80e371 Mon Sep 17 00:00:00 2001 From: void Date: Tue, 2 Feb 2021 17:20:54 +0000 Subject: [PATCH] editor: no se por que falla esto MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pero es medio chota la forma en que lo hace así que no me sorprende. igualmente esto no debería pasar. --- app/assets/javascripts/02-editor.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/assets/javascripts/02-editor.js b/app/assets/javascripts/02-editor.js index 746141c..79d09f9 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) } } }