Page MenuHomePhabricator

Highlight definition lists
Open, LowPublic

Description

Currently, in

:foo
;bar

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

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