WordPress : Safari

If you’ve been trying to write posts in the WordPress TinyMCE editor using the Safari web browser, you might have noticed that breaklines are not correctly treated and that your posts end up being a single block of text rather than paragraphs as expected.

This is because of a conflict or a bug between Safari and TinyMCE. Whomever is to blame for this is unknown, but a fix or workaround has not been made available by either the webkit developers or the WordPress team itself. So this post will show you how to fix up TinyMCE in order to start writing WordPress posts using Safari.

First off, go to "/wp-includes/js/tinymce/" and open up the "tiny_mce.js" file with your text editor. With the file open, go to line #4025 where you will see the following block of code. It is a simple IF statement.

if (tinyMCE.isSafari && this.formElement)
    this.formElement.innerText = htm;

Now comment out those two lines of code inside the "tiny_mce.js" file so that it looks like this :

//if (tinyMCE.isSafari && this.formElement)
//  this.formElement.innerText = htm;

And that’s all there is to it. Re-upload the "tiny_mce.js" file to its original directory, overwriting the original file. You can now go to your WordPress "Write" section, but one you have opened this page, remember to clear your browser cache and refresh the page so that the new JS file can be loaded into your browser.

Now you can start writing posts and pages in WordPress using Safari

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>