Description
Details
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T2209 [DO NOT USE] HTML validity (tracking) | |||
Resolved | divadsn | T182968 Timeline extension error messages should not use deprecated tag <tt> |
Event Timeline
I could mentor this task for GCI, if I could get more information on what could be used instead of <tt>.
Probably CSS, since the way it is used at
https://en.wikipedia.org/wiki/Special:ExpandTemplates?wpInput=<timeline>foobar<%2Ftimeline>#output
doesn't look like something where pre, code, kbd, var or samp would be valid.
Looking at other MediaWiki extensions using <div class="error">, I see stuff like
$this->getOutput()->wrapWikiMsg( '<div class="error">$1</div>', $args );
so I guess this should not set <tt> or any CSS at all but leave the rendering to whatever CSS is defined for class="error".
On the other hand, the current output seem to be several lines. So just dropping <tt> will make that less readable. Should it really output the version number, for example? I doubt.
Imported and published as a GCI task in https://codein.withgoogle.com/tasks/5500338910003200/ but the student will have to thoroughly test the output!
No problem, can you give me please an example on how those errors can be triggered? :)
According to this page (https://www.w3schools.com/tags/tag_tt.asp) the tt tag can be replaced with samp for computer output, so I think that should be a good solution.
Change 399171 had a related patch set uploaded (by Divadsn; owner: Divadsn):
[mediawiki/extensions/timeline@master] Replace deprecated tt tags with samp tag
I was looking right now at what caused some TT tags to appear on it.wiki and, as I realized that it was due to this extension, I started to set up a patch. Fortunately I've seen this task before doing anything :-) FYI on it.wiki we replaced TTs with KBDs, and the result is the same with the three tags. Also, if you need to have the error message on multiple line, where tt would break, we used a DIV with style "font-family: monospace; font-size:14px" which perfectly replicates the TT's behaviour.
Change 399171 abandoned by Divadsn:
Replace deprecated <tt> tag with <samp> tag in error output
Reason:
Patch to be reworked.
Change 400108 had a related patch set uploaded (by Divadsn; owner: Divadsn):
[mediawiki/extensions/timeline@master] Replace deprecated <tt> tag with custom styled <div> tag in error output
Thanks @Daimona, I took your suggestion and adjusted the font-size to match the one from tt, also behaves the same with different screen sizes.
Change 400108 merged by jenkins-bot:
[mediawiki/extensions/timeline@master] Replace deprecated <tt> tag with custom styled <div> tag in error output