Timeline extension error messages should not use deprecated tag <tt>
Closed, ResolvedPublic

He7d3r created this task.Dec 15 2017, 10:50 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptDec 15 2017, 10:50 AM
Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptDec 15 2017, 10:50 AM

@He7d3r : Any recommendations what it should use instead of <tt>?

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.

Aklapper renamed this task from Timeline should not use deprecated tag <tt> to Timeline extension error messages should not use deprecated tag <tt>.Dec 19 2017, 10:21 AM

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!

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? :)

divadsn claimed this task.Dec 19 2017, 11:30 AM

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

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

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.

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

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

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

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

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

divadsn closed this task as Resolved.Dec 28 2017, 8:35 PM