I also found the reason. In the original note, code formatting was achieved with a <code> tag. When I typed the dashes, the editor wraps that tag around a <span> tag, which causes HTML rendering engines (both Chrome and the Evernote editor itself) to stop rendering that block of text as pre-formatted.
I can see why losing the pre-formatting is necessary when the text is highlighted, because Evernote notes are backed by HTML and HTML doesn’t have a way to display text that's both preformatted and highlighted. But why did editing one place cause all text in other places that's wrapped in the same HTML tag to also change? Perhaps the backend is using an XML/HTML selector that’s selecting too many elements when it should only select one? And then, perhaps there’s an event listener that listens to changes to elements matching that selector and wraps the changed text in a <span> tag? (That seems plausible to me because the new “unified experience" editor is supposedly JavaScript-powered now.)
In that case, this wouldn’t just be an obscure bug that’s only triggered when someone types two dashes (or a number and a dot, like "1.") in a code block - it’d be at least a medium-impact bug that’s triggered whenever that event listener is triggered and causes destructive changes that are difficult to notice and difficult to undo if not noticed promptly.
Idea
linhb 0
0 replies to this idea
Recommended Posts
Archived
This topic is now archived and is closed to further replies.