Page MenuHomePhabricator

[Suggestion] Detect "fake" headings that are just bold text rather than using heading markup
Closed, ResolvedPublicFeature

Description

Sometimes people try to make a heading, and because subheading 2-4 all look like just bolded text in Vector (and subheading 1 just looks like slightly-larger bold text), they bold it rather than using heading markup. This visually works, but means these "headings" don't show up in the table of contents. (And the accessibility isn't great.)

We should detect paragraphs that are completely covered by a bold annotation, and offer to convert them to a heading.

The complexity of this, compared to T412878, is that it's not necessarily obvious which heading level to offer. Possible options include:

  • The same as the previous heading
  • One below the previous heading
  • Either of the former, but never higher than "sub-heading 1" (because it's the first one that looks almost-identical to bolded text)

(And this all only holds if the person is editing in Vector. Other skins have different styling for headings.)

Event Timeline

Change #1219220 had a related patch set uploaded (by DLynch; author: DLynch):

[mediawiki/extensions/VisualEditor@master] Experimental edit check: fake headings

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

Change #1219220 merged by jenkins-bot:

[mediawiki/extensions/VisualEditor@master] Experimental edit check: fake headings

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

It's a disabled-by-default check, so make sure to enable it.

Either of the former, but never higher than "sub-heading 2" (because it's the first one that looks identical to bolded text)

I noticed an occurrence where I clicked "Fix" the bolded text got converted to sub-heading 1. Screen Capture:

Also, just like with the heading level check after converting the bold paragraph to a heading, the cursor moves down to the next line

An adjustment was made this morning in https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/1237376 and https://gerrit.wikimedia.org/r/c/mediawiki/extensions/VisualEditor/+/1237459 (not tagged against this, oops) which will have fixed the selection issue.

It giving you a subheading 1 was actually deliberate in the end, though I apparently forgot to update the spec in the ticket. At Ed's suggestion in the gerrit patch we went with <h3> as the default if there's not a preceding less-than-h3 heading to match. It's a bit ambiguous because that's the one which is bold-text-but-bigger so it's not perfectly identical to a regular heading... but there's also something to be said for making a small visible change when you act on it. We might want to revisit this in response to user feedback later.