Hi, I’m seeing unexpected behavior from autoCloseTags in @codemirror/lang-html.
Starting with:
<div>
</div>
When I type another <div> inside the existing element, the result is:
<div>
<div>
</div>
I expected:
<div>
<div></div>
</div>
The syntax tree appears to associate the existing </div> with the newly typed inner <div>, leaving the outer <div> unclosed. Tag-matching highlighting also shows the inner opening tag and the existing closing tag as a pair.
This is especially noticeable with nested elements of the same name. Tags with a different name close as expected because the existing closing tag cannot be paired with the new opening tag.
Is this intended behavior, or would it make sense for autoCloseTags to distinguish between a closing tag that existed before the input and one belonging to the newly typed element?