4 ms·
I have same question, it is easy to solve in rich text environment [1]. But it is also possible to solve quotes in quotes. Browser solves it beautifully — we ne
by sergeykish 6y ago
I have same question, it is easy to solve in rich text environment [1]. But it is also possible to solve quotes in quotes. Browser solves it beautifully — we never think how <>& escaped while reading the page, it just works in contenteditable.
let encoded = this.textContent.replaceAll("\n", "\\n")
.replaceAll('"', '\\"')
return `"${encoded}"`
[1] http://sergeykish.com/c-multiline-string http://sergeykish.com/c-multiline-string