Page MenuHomePhabricator

Auto-closing of tags in wikitext
Closed, ResolvedPublic

Description

The upstream autoCloseTags extension works great (and by default) for Vue, HTML, XML, etc. It would be great to have the same functionality for the mediawiki mode.

In particular, this is deemed valuable to users of the Math extension. Quoting from Community Wishlist/W141:

Writing <math>x</math> quickly gets cumbersome for simple variables that you need to mention multiple times per sentence, so articles tend to use ''x'' instead.

The number of keystrokes could be reduced dramatically if we had auto-closing of tags.

Event Timeline

Change #1253500 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] closeTags: automatically insert close tags when `>` is typed

https://gerrit.wikimedia.org/r/1253500

Bhsd changed the task status from Open to In Progress.Mar 16 2026, 1:53 PM
Bhsd claimed this task.

Change #1253500 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] closeTags: automatically insert close tags when `>` is typed

https://gerrit.wikimedia.org/r/1253500

Change #1255226 had a related patch set uploaded (by Bhsd; author: Bhsd):

[mediawiki/extensions/CodeMirror@master] codemirror.mediawiki.autocomplete: nearest unclosed tag

https://gerrit.wikimedia.org/r/1255226

Change #1255226 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] codemirror.mediawiki.autocomplete: nearest unclosed tag

https://gerrit.wikimedia.org/r/1255226

Bhsd moved this task from Improvement to Done on the MediaWiki-extensions-CodeMirror board.