If an HTML comment is on either side of a heading, the heading won't get highlighted and the size won't change.
Watch this GIF and you will understand:
https://upload.wikimedia.org/wikipedia/commons/b/be/HTML_comments_and_headings.gif
kaldari | |
Jul 19 2017, 5:44 PM |
F34954815: image.png | |
Feb 20 2022, 2:04 AM |
If an HTML comment is on either side of a heading, the heading won't get highlighted and the size won't change.
Watch this GIF and you will understand:
https://upload.wikimedia.org/wikipedia/commons/b/be/HTML_comments_and_headings.gif
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Highlight headings with trailing comments | mediawiki/extensions/CodeMirror | master | +17 -7 |
There are two problems:
For the first point we should choose:
The second point requires the same solution as for complicated templates T108450 and touches T109822
I talked this over with @kaldari and @Niharika -- I don't want to break a useful feature (size changes on the heading) just to fix an edge case.
When there's a heading with inline comments, we should make the whole line the size of a heading. That gives us occasional big comments, but if the comment is on the same line as the heading then it's probably important.
In the translation use case from the GIF, having a big <!--T:5--> next to the heading would probably help -- you'd be able to tell which translate tags are connected to headings, and which aren't. The translate feature is ugly and confusing; this would be just as ugly but maybe a little less confusing.
Change 763600 had a related patch set uploaded (by AntiCompositeNumber; author: AntiCompositeNumber):
[mediawiki/extensions/CodeMirror@master] Highlight headings with trailing comments
Took a shot at adding support for trailing comments. I didn't do leading comments because it would be more complex and I don't have a use case for it. Matching the size to the rest of the line makes sense to me.
Change 763600 merged by jenkins-bot:
[mediawiki/extensions/CodeMirror@master] Highlight headings with trailing comments