Safari 3, Wordpress 2, TinyMCE and paragraphs

bgk on Oct 13th 2007

If you’re wondering why your paragraphs disappear when using the ‘Rich Editor’ features with Safari 3 and Wordpress, then look no further.  Well, at least I can point you on the right track.

I first noticed this problem with the release of Safari 3 beta, and soon discovered that changing the UserAgent (UA) to Firefox eliminated the problem.  I’d hoped it would only be a matter of time before the Wordpress folks undid whatever they’d done in their integration of TinyMCE.  However, two point releases later and it appears the problem is still there.

So, this morning I made a very simple change to  

	$WPHome/wp-includes/js/tinymce/tiny_mce.js

Namely, line 33, do the following

//      this.isSafari = ua.indexOf('Safari') != -1;
        this.isSafari = false; 

This removes all the Safari specific hacks and now my paragraphs work nicely.  (You may need to quit and reload Safari for this to take effect).

Almost surely this breaks a whole bunch of things, but if you just need the basic editing features of TinyMCE, then until Wordpress gets their act sorted, this should do the job nicely.   Perhaps someone with a bit more time can go through this same file and see which of the hacks causes the problem. See comments.

Filed in Computers |

2 Responses to “Safari 3, Wordpress 2, TinyMCE and paragraphs”

  1. Joelon 01 Nov 2007 at 21:59

    Nice. I just upgraded to Leopard and immediately noticed this problem. Glad to see there is such an easy fix.

  2. Arnoudon 07 Nov 2007 at 18:20

    I made a change in line 7572, to keep all the other hack working. Just remove the Safari part.

    // if ((tinyMCE.isGecko || tinyMCE.isOpera || tinyMCE.isSafari) && tinyMCE.settings.force_p_newlines && e.keyCode == 13 && !e.shiftKey) {

    to:

    if ((tinyMCE.isGecko || tinyMCE.isOpera) && tinyMCE.settings.force_p_newlines && e.keyCode == 13 && !e.shiftKey) {

    I have not checked if the other Safari hacks are still necessary for Safari 3.

Trackback URI | Comments RSS

Leave a Reply