The Case of the Disappearing Strikethrough Tags

That bit of TinyMCE tweaking and its follow-up have come in handy again.

Something I like to do from time to time is to cross out bits of text for humorous effect. This always used to work just fine, but the combination of using Google Chrome and the WYSIWYG editor leads to an oddness.[1] Save the post, or switch to the HTML editor and the strikethrough effect goes away. What’s interesting, is that if I added the strikethrough using the HTML editor, it would survive switching to the WYSIWYG editor.

So, it would seem the two editors are using different methods. Sure enough, if you click the strikethrough button in the HTML editor, this is what gets inserted:

<del datetime="2010-04-05T08:51:29+00:00">delete me</del>

But the WYSIWYG editor puts in the

<s>tag</s>

Which is a bit silly of it, as it’s not one of the tags it likes, and so it strips it out. This seems to be particular to how TinyMCE works with Google Chrome, as when using Firefox and Safari, it uses the quite sensible:

<span style="text-decoration: line-through;">strikethrough</span>

Now I could add a custom style to the drop down thingy to replicate that, but as I’d rather keep it simple and carry on clicking the appropriate button, I added “s” after “iframe” in the list of additionally allowed tags, which seems to have worked nicely.

I’m guessing that the problem is that the version of TinyMCE supplied with WordPress doesn’t really understand Chrome, and so is reverting to some odd defaults. This will probably be fixed at some point…

Once agan, refer to Esther’s article for instructions.

Since Safari was updated to version 5, and presumably a newer version of Webkit, it is also getting the “s” tag for Strikethrough. And it seems that in one of my site edits, I lost the change that made that work in Chrome (possibly because I gave up on Chrome). Fixed again now.

 

[1] Other browsers may also be affected

4 thoughts on “The Case of the Disappearing Strikethrough Tags

    1. Les Post author

      You can follow the same steps I did – follow the links for details of what to edit, or wait for an update that will fix it. It’s been logged as a WordPress bug, so something should be done. Failing that, use Firefox!

  1. Les Post author

    And for anyone who’d rather not get involved with editing files, this will be fixed in the forthcoming WordPress 3.1 (release date to be confirmed).

Comments are closed.