Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter falconsfan

    (@falconsfan)

    I tracked down the reason behind why I can’t just edit the database and change the URL. It has to do with the way WordPress stores it’s data using PHP Serialization.

    There is a script that helps with migrating WordPress sites from one URL to another but it’s not made for end users and you need to make sure to make a backup copy of your data before running it:

    http://www.davesgonemental.com/mysql-database-search-replace-with-serialized-php/

    If you comment out the sections of code I noted above and make sure that all text is contained in a paragraph tag (which is valid html anyway) then the editor works perfect, at least it has for me.

    It stops adding additional paragraph tags and leaves the code as you enter it. So if you add additional blank lines and you have the option checked to stop removing those tags, then they are left in AND you don’t get the annoying extra tags that it had been inserting every time you save.

    I just noticed that if I have an image or text that is not wrapped in in a paragraph tag, that is when it continually inserts the unwanted tags.

    The page that I noticed this happening on had text inside a table cell but was not using paragraph tags, when I put the text inside p and /p tags the issue went away.

    Sorry folks, I thought that resolved the issue but I just noticed that it is still doing it.

    Everytime I save the page it adds a new <p></p>, very irritating.

    I’m having the same problem but I believe I found a work around. I don’t know what all this will affect but it does appear to resolve the problem.

    I’ve edited plugins/tinymce-advanced/js/tadv_replace.js as by commenting out the following lines (basically any reference to paragraph tags) :

    pre_format : function(c) {
    
    		c = c.replace(/<(pre|script)[^>]*>[\s\S]+?<\/\1>/g, function(a) {
    			a = a.replace(/<br ?\/?>[\r\n]*/g, '\n');
    			return a.replace(/<\/?p( [^>]*)?>[\r\n]*/g, '\n');
            });
    
    		/*
    		c = c.replace(/<p>(\s|<br ?\/?>|\u00a0)*<\/p>/g, '<p><br class="spacer_" /></p>'); // keep empty paragraphs...
    		*/
            c = c.replace(/\[\/sourcecode\]\s*<br \/>\s*<br \/>/g, '[/sourcecode]\n');
    		/*
    		c = c.replace(/<p( [^>]*)?>/g, '\n<p$1>');
    		c = c.replace(/<\/p>/g, '</p>\n');
    		c = c.replace(/<\/p>\s*<p/g, '</p>\n\n<p');
    		*/
    		c = c.replace(/<((blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])[^>]*)>\s*<p/g, '<$1><p');
    		c = c.replace(/<\/p>\s*<\/(blockquote|ul|ol|li|table|thead|tbody|tr|th|td|div|h[1-6])>/g, '</p></$1>');
    		c = c.replace(/<br ?\/?>[\r\n]*/g, '<br />\n');
    		c = c.replace(/<li([^>]*)>/g, '\t<li$1>');
    		c = c.replace(new RegExp('\\s*\\[caption([^\\[]+)\\[/caption\\]\\s*', 'gi'), '\n\n[caption$1[/caption]\n\n');
    		c = c.replace(new RegExp('caption\\]\\n\\n+\\[caption', 'g'), 'caption]\n\n[caption');
    
    		c = c.replace(/<object[\s\S]+?<\/object>/g, function(a) {
    			return a.replace(/[\r\n]*/g, '');
            });
    
    		return tinymce.trim(c);
    	},

    I’m experiencing this problem as well but I’ve noticed that people are saying that it works in IE so I decided to try a FireFox extension that I have installed called IE Tab which basically allows you to view a page as though you were running IE. Using this extension now allows the edit HTML to work. It’s a work around but it beats having to go to the user profile, uncheck the rich editor option, going back to edit the page/post, blah blah blah, and it allows me to continue to work in FireFox.

Viewing 6 replies - 1 through 6 (of 6 total)