From 8d1e9681f6b63095a898dfa7d22ea7b028ebbbaf Mon Sep 17 00:00:00 2001 From: Aljaz Grilc Date: Thu, 28 Mar 2024 07:59:55 +0100 Subject: [PATCH] Tweak handleInput function for better handling of textareas --- service.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service.js b/service.js index adf7e56..dded9ca 100644 --- a/service.js +++ b/service.js @@ -758,6 +758,7 @@ class BesTAService { lines.forEach(line => { const divEl = document.createElement('div') divEl.textContent = line + if (line === '') divEl.innerHTML = ' ' this.cloneDiv.appendChild(divEl) }) this.cloneDiv.dispatchEvent(customEvent) @@ -787,7 +788,7 @@ class BesTAService { /** * This function handles the replacement of the text in the textarea element * - * @param {HTMLElement} el Element to replace the text in + * @param {HTMLElement} el Element whose outerText will be used as a replacement */ handleReplacement(el) { // TODO: think of a way to reposition the cursor after the replacement