Page MenuHomePhabricator

Highlight definition lists
Open, LowPublic

Description

Currently, in

;foo
:bar

or

;foo:bar

only the colon is highlighted, not the semicolon. They should both be highlighted.

Task Description:

QA Results - Beta

ACStatusDetails
1T170042#9784725

Event Timeline

+1.

For colors, I'd suggest either duplicating the existing -indenting scheme:
.cm-mw-indenting { color: #08f; font-weight: bold; background-color: #ddd; }

or perhaps making a new class, with the background 2 shades darker:
.cm-mw-definition { color: #08f; font-weight: bold; background-color: #bbb; }

Schnark, good catch on the semicolon -- that should be the same blue as the colon.

But why is there a gray background behind the colon? I'm looking at it with Niharika, and we think that's a bug. I don't think there's supposed to be a background like that...

Schnark, good catch on the semicolon -- that should be the same blue as the colon.

But why is there a gray background behind the colon? I'm looking at it with Niharika, and we think that's a bug. I don't think there's supposed to be a background like that...

The semi-colon has a specific use to create HTML <dt> tags (Description list - Term).
The usage is semantically meant to be followed by a :colon (which makes a <dd> HTML tag - (Description list - Description).
Articles follow this practice, which should be encouraged. But allowances do also need to be made for the historical/universal misuse of the colon on discussion pages, merely to create an "indent".

All of which to say:

  • It would be great if we could bold the string that follows the semi-colon, but it must end at the first colon. (which sometimes are on the same line as the semi-colon)

That will make it a LOT easier to read/write articles, where they have definition lists.
E.g.
https://en.wikipedia.org/wiki/Glossary_of_musical_terminology
https://en.wikipedia.org/wiki/Glossary_of_elementary_quantum_mechanics
https://en.wikipedia.org/wiki/Glossary_of_equestrian_terms


I.e. it should match both of these:

; Term : Definition

; Term
: Definition

Agree with the Quiddity bold suggestion. The "indent" name is very unfortunate.

Not quite a fan of the background thing though. I think a blue colon and a bold term is good enough; backgrounds can get very distracting.

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

[mediawiki/extensions/CodeMirror@master] improve treatment of lists at start of line

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

Change 991613 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] improve treatment of lists at start of line

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

Seems good! Doesn't seem like it shipped on enwiki tho

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

[mediawiki/extensions/CodeMirror@master] CodeMirrorModeMediaWiki: one-line definition list

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

MusikAnimal subscribed.

Could use QA resources.

QA notes: test anywhere CodeMirror 6 is enabled (T357795)

Change #1007579 merged by jenkins-bot:

[mediawiki/extensions/CodeMirror@master] CodeMirrorModeMediaWiki: one-line definition list

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

Thanks @Bhsd ! Quick question @MusikAnimal, can you review the Needs More Info section? Thanks!

Status: ✅PASS
Environment: Beta: 1.43.0-alpha (6786926)
OS: macOS Sonoma 14.4.1
Browser: Chrome 124, Firefox 125, Safari 17.4
Skins. Vector 2022, Vector 2010, Minerva, Monobook, Timeless
Device: MBA M2
Emulated Device:: n/a
Test Links:
https://ar.wikipedia.beta.wmflabs.org/w/index.php?title=%D8%A8%D8%B1%D9%83%D8%A7%D9%86&action=edit
https://office.wikimedia.org/w/index.php?title=HR_Corner%2FWMF_Employee_Discounts&veaction=editsource

✅AC1: https://phabricator.wikimedia.org/T352491

MediawikiEn BetaSimple.WikipediaHe BetaEs Beta
2024-05-09_13-48-26.png (508×2 px, 131 KB)
2024-05-09_13-53-53.png (459×1 px, 109 KB)
2024-05-09_13-54-42.png (458×1 px, 93 KB)
2024-05-09_13-58-35.png (417×1 px, 79 KB)
2024-05-09_14-18-19.png (544×2 px, 278 KB)

❓ Need More Info

I thought based off (T357795), all Betas and Office should have CM6 since they are checked off. I found syntax highlighting in Office but the semi-colon is not highlighted. Also, I don't see anything on Ar Beta. Am I missing an option to get CM6?

https://office.wikimedia.org/User:

2024-05-10_06-25-42.png (709×2 px, 125 KB)

https://ar.wikipedia.beta.wmflabs.org/w/index.php?title=%D8%A8%D8%B1%D9%83%D8%A7%D9%86&action=edit

2024-05-09_14-24-44.png (526×2 px, 230 KB)

Note that proper usage would be

;bar
:rry

or ;bar:rry, as the bolded is the term and the indented is the definition. I don't think things would change though, and all of these cases should be highlighted.

Quick question @MusikAnimal, can you review the Needs More Info section? Thanks!


I thought based off (T357795), all Betas and Office should have CM6 since they are checked off. I found syntax highlighting in Office but the semi-colon is not highlighted. Also, I don't see anything on Ar Beta. Am I missing an option to get CM6?

For Office Wiki, you appear to be using the 2017 editor. Try disabling "Use the wikitext mode inside the visual editor, instead of a different wikitext editor" in your preferences.

CodeMirror for RTL is only on select wikis, and I didn't update the config for Beta yet. I'll get a patch in for that today and CM6 will be back on all beta RTL wikis. Testing at just beta Hebrew should be sufficient, so I don't think you need to test on any other RTL wikis.

Note that proper usage would be

;bar
:rry

Indeed. The task description had it wrong, now fixed.