Highlight definition lists
Closed, ResolvedPublic

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
1โœ…T170042#9850571

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJul 8 2017, 8:33 AM

+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.

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.

"Today" from May 10 ended up being today today, as in May 30 :-P

The patch is not merged as of the time of writing, but as I said, for this task I think testing on Hebrew Wikipedia (production) is sufficient. Moving back to QA

@MusikAnimal Got it. After disabling the 2017 editor in office, it was working. Based on the testing from T170042#9784725 and the ones from below, this looks to be working as designed. I will move this to Done. Thanks for all your work!

OfficeHE
2024-05-31_07-53-29.png (433ร—1 px, 90 KB)
2024-05-31_08-15-04.png (595ร—2 px, 133 KB)

I'm assuming the QA for single-line ;bar:rry also highlights both correctly?

Will ship with CM6 as it's rolled out. See T357795 for the deployment task. I'm currently trying to finish up T357482 before deploying further, so we're talking maybe a matter of weeks.