Page MenuHomePhabricator

Enable TextMatch to limit a Check to headings only
Open, MediumPublic3 Estimated Story PointsFeature

Description

Feature summary:
Enable users writing a textMatch check to limit it to only headings.

Use case(s):
E.g. Russian Wikipedia editors would like to be able to create a Suggestion that detects "== Жизнь ==" ("Life") and suggests replacing it with "== Биография ==" ("Biography") to match their local standard.

Benefits:
There are likely to be many other similar textMatch Suggestions that various communities will want to create.

Development notes:
In discussion, devs suggest:

“type of node” is a thing we might want to generically implement, and then let textMatch rules inherit. [Similar to the existing] “only in a paragraph” hardcoded for some checks.

but they also note:

This would be a bit confusing to the people writing the configuration, though, since we'd need them to understand the difference between a node and an annotation

Requirements

Per offline discussion, we will enable the functionality described above by introducing a new capability that would enable any Check or Suggestion to be scoped to a particular node within the VE document model.

Open question(s)

  • 1. What will the new configuration capability "Requirements" above specifies?
    • Note: offline ContentIsOnly was proposed, I think.

Done

Event Timeline

VPuffetMichel set the point value for this task to 3.Apr 8 2026, 5:06 PM

Hi! I’ll just add that I had an idea about replacing some section titles in the Russian Wikipedia:

  • Биография и карьера → Биография (Biography and career→ Biography)
  • Внешние ссылки → Ссылки ( External links → Links)
  • Официальные ссылки → Ссылки (Official links → Links)

So an option that works only for section headings would be very useful.

Hi! I’ll just add that I had an idea about replacing some section titles in the Russian Wikipedia:

  • Биография и карьера → Биография (Biography and career→ Biography)
  • Внешние ссылки → Ссылки ( External links → Links)
  • Официальные ссылки → Ссылки (Official links → Links)

So an option that works only for section headings would be very useful.

Oh! Seeing examples of the sorts of suggestions this functionality would enable is very helpful...I'm glad you stopped by to share as much, @Mitte27 !

Per Wednesday's offline discussion, the Editing Team estimated this task as a 3 with the assumption that we'd enable the functionality this ticket is currently describing by introducing a more generic capability that would enable volunteers to scope Checks/Suggestions to specific elements on the page.

Per offline discussion, we are okay with the confusion proceeding with what T422431#11806719 describes [1] because we assume this confusion [2] can be resolved through clear documentation.


  1. "This would be a bit confusing to the people writing the configuration, though, since we'd need them to understand the difference between a node and an annotation."
  2. We think this confusion has less to do with "How do i scope this textmatch suggestion to ___?" and more to do with "How come I can scope this textmatch suggestion to X, Y, and Z  and not A, B, and C when A, B, C, X, Y, Z seem the same in my mind?"

#TODO: update task description to reflect:

  1. Decision to implement this functionality via a more generic capability
  2. Need for a part of this ticket to include updating https://www.mediawiki.org/wiki/Edit_check/TextMatch#Configuration to say something like:
    • ContentIsOnly: If true, this check will only look for text that is the sole-content within a [Paragraph / Heading / Blockquote]. If there is any other content, the check will be skipped. [1]

  1. Thank you for spotting the need for this and proposing this language, @Quiddity
ppelberg triaged this task as Medium priority.Apr 10 2026, 11:44 PM
ppelberg updated the task description. (Show Details)
ppelberg updated the task description. (Show Details)

Change #1275380 had a related patch set uploaded (by Esanders; author: Esanders):

[mediawiki/extensions/VisualEditor@master] TextMatchEditCheck: Add inNode option

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

Change #1275380 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] TextMatchEditCheck: Add inNode option

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