I have created tag b and am typing characters in it.
I then remove characters with backspace.
The tag b disappears from the DOM tree.
Then I press any character and the tag b reappears.
Question: where is the information that a tag will appear when a key is pressed?
UPD: minimal reproducible example:
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>doc</title>
</head>
<body>
<pre style='font-family: "Times";'>
<div class="editor">Delete and create <b>Blod</b></div>
<div class="editor">Delete and create <b>Blod</b><div>After element.</div></div>
</pre>
<script>
document.designMode = "on";
document.body.spellcheck = false;
</script>
</body>
</html>
You need to look at the DOM tree. I also noticed an inadequate reaction if there is an element next.