# HTML rename start and ending tag

**URL:** https://discuss.codemirror.net/t/html-rename-start-and-ending-tag/9499
**Category:** v6
**Created:** [September 11, 2025, 1:08pm UTC](https://discuss.codemirror.net/t/html-rename-start-and-ending-tag/9499 "2025-09-11T13:08:48Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![shshaw](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/shshaw/32/2184_2.png) [@shshaw](https://discuss.codemirror.net/u/shshaw)
#### Post date: [September 11, 2025, 1:08pm UTC](https://discuss.codemirror.net/t/html-rename-start-and-ending-tag/9499/1 "2025-09-11T13:08:48Z")

</div>

When using lang-html, is there a way to enable renaming both the start and end tag?

E.g. If you have `<div>Hello</div>` , can you rename to `<h1>Hello</h1>` by only selecting one of the tags and typing `h1`?

This used to be possible in CodeMirror 5 but `matchBrackets` functionality in CodeMirror 6 and `matchClosingTags` in lang-html don’t seem to work in the same way. Not sure the official name for that feature, so maybe my searches have just been wrong.

---

<div class="post-metadata">

### Author: ![marijn](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/marijn/32/136_2.png) [@marijn](https://discuss.codemirror.net/u/marijn)
#### Post date: [September 11, 2025, 7:00pm UTC](https://discuss.codemirror.net/t/html-rename-start-and-ending-tag/9499/2 "2025-09-11T19:00:59Z")

</div>

It is possible to implement something like this using the parse tree, but indeed, lang-html doesn’t provide it as a command or similar.

---

<div class="post-metadata">

### Author: ![shshaw](https://discuss.codemirror.net/user_avatar/discuss.codemirror.net/shshaw/32/2184_2.png) [@shshaw](https://discuss.codemirror.net/u/shshaw)
#### Post date: [September 9, 2026, 9:12pm UTC](https://discuss.codemirror.net/t/html-rename-start-and-ending-tag/9499/3 "2026-09-09T21:12:47Z")

</div>

Just wondering if this has changed at all in the past year.

Are there any ways built-in to CodeMirror to offer renaming the start and end tag at the same time?

If that functionality isn’t available, how would you even go about adding that?
