cursorPos = textarea.selectionStart;
                const endSelection = textarea.selectionEnd;
                if (cursorPos === endSelection) {
                    return;
                }
                const textBeforeCursor = textarea.value.substring(0, cursorPos);
                const textAfterCursor = textarea.value.substring(cursorPos);
        
                const pre = document.createTextNode(textBeforeCursor);
                const post = document.createTextNode(textAfterCursor);
          