Last modified: 2013-10-06 16:30:22 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T6557, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 4557 - <strike> tag is deprecated in HTML5; normalize to <s> in parser/sanitizer
<strike> tag is deprecated in HTML5; normalize to <s> in parser/sanitizer
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
All All
: Lowest enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: 7924 (view as bug list)
Depends on: 40579
Blocks: html semantic-html
  Show dependency treegraph
Reported: 2006-01-10 20:31 UTC by ejsanders
Modified: 2013-10-06 16:30 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description ejsanders 2006-01-10 20:31:18 UTC
...and should be replaced by <del> tags. All the UAs I've checked render this is
struck-through text, although the w3c spec does not require this - so it could
be enforced with CSS.
Comment 1 Brion Vibber 2006-01-10 20:48:03 UTC
They're still legal, no reason to change them. If at some point we transition to 
XHTML 1.0 Strict or some other version without those elements, then of course we 
could output a different element type conforming with those specs.
Comment 2 ejsanders 2006-01-10 21:02:20 UTC
Indeed, but it's better not to use deprecated tags. Surely it's fairly simple to
Comment 3 Brion Vibber 2006-01-10 21:06:57 UTC
Not better; just more complicated with no benefit. The idea of deprecating <s> isn't to blindly 
replace them all with <span style="font-decoration: strikethrough">; it's to plan to use 
semantically appropriate elements or classes when you write new documents.

If we *had* to perform such blind replacement, such as for outputting a future version of HTML 
that doesn't support <s>, we could do so. But doing so with XHTML 1.1 Transitional doesn't make 
any sense. It doesn't make the code semantically better. It doesn't make it more compatible. It 
doesn't make it more meaningful. It doesn't do anything but complicate the code and increase 
the size of output.
Comment 4 Chad H. 2011-11-29 19:57:34 UTC
*** Bug 7924 has been marked as a duplicate of this bug. ***
Comment 5 Brion Vibber 2011-11-29 21:38:07 UTC
HTML 5 appears to have obsoleted <strike> but *not* <s>:

Judging by the spec actually, <s> sounds more right than <del> for most usages other than document addition/removal markup:

I don't see any active use of <strike> in MediaWiki or any of our SVN extensions; it's allowed through the HTML sanitizer, and that would be the place to normalize it to <s> if necessary in future.

Retooling this to an enh request to normalize <strike> to <s>.
Comment 6 S. McCandlish 2011-11-30 07:38:21 UTC
Brion Vibber wrote:
> Retooling this to an enh request to normalize <strike> to <s>.

That sounds entirely reasonable, and it really can be done any time, because <strike> and <s> ARE semantically identical.   FWIW, I tend to agree with others that replacing both with CSS that amounts to <span style="font-decoration: strikethrough;"> actually IS perfectly fine, from a code properness point of view (the two elements don't mean anything semantic, only presentational, i.e. "this is struck-through text", which is precisely what the CSS version means), but I also agree with the counterpoint that it doesn't really buy us anything and make the code longer. No reason to do that if HTML5 will still support <s> as non-deprecated markup.  And I concur that they are not interchangeable with <del>.  Many editors on Wikipedia use them all as if they were, but this is a mistake.
Comment 7 Krinkle 2011-12-29 11:06:16 UTC
Note that this kind of normalization can also break stuff, such as CSS rules set for 'strike' (both in core as well as extensions and site/user scripts).
Comment 8 Daniel Friesen 2012-09-27 18:21:07 UTC
Technically HTML5 actually defines <s> as "The s element represents contents that are no longer accurate or no longer relevant." rather than as a strike-through. But that probably doesn't really matter since HTML4 defined both <strike> and <s> as strike-through. So whether you used <strike> or <s> HTML5 still changes the semantics.

Note You need to log in before you can comment on or make changes to this bug.