webmail: when quoting text that switches unicode blocks (as highlighted), don't lose the switched text

by using a String object as the textarea child.  instead of a regular js string
that would be unicode-block-switch-highlighted, which would cause it to be
split into parts, with odd or even parts added as span elements, which the
textarea would then ignore.
This commit is contained in:
Mechiel Lukkien
2023-10-14 14:47:24 +02:00
parent a40f5a5eb3
commit 56956c224b
5 changed files with 27 additions and 3 deletions

View File

@ -711,6 +711,11 @@ const [dom, style, attr, prop] = (function () {
if (typeof c === 'string') {
formatText(e, c);
}
else if (c instanceof String) {
// String is an escape-hatch for text that should not be formatted with
// unicode-block-change-highlighting, e.g. for textarea values.
e.appendChild(document.createTextNode('' + c));
}
else if (c instanceof Element) {
e.appendChild(c);
}