This is handled by a key binding:
// HTML, XML close tag
{ "keys": ["/"], "command": "close_tag", "args": { "insert_slash": true }, "context":
[
{ "key": "selector", "operator": "equal", "operand": "(text.html, text.xml) - string - comment", "match_all": true },
{ "key": "preceding_text", "operator": "regex_match", "operand": ".*<$", "match_all": true },
{ "key": "setting.auto_close_tags" }
]
}
That is, when you /
after a <
key, the internal close_tag
command is executed to look backwards, find the appropriate tag, and close it.
That said, this won’t happen unless you actively are trying to close a tag, so that doesn’t seem like the situation you’re seeing here though (if it is, my advice is to not try to close tags you don’t want closed
).
What steps are you taking that’s making the end tag appear? Wrapping selection with a tag?