So I create a nicely formatted post, using the flexible ‘Visual’ editor within WordPress (please no code-monkey fan-boy flaming for this… :p) – however I need to add some code to the post, using my shiny new DirtyCode plugin. So I switch over to the HTML editor, add my dirtycode tags, and wrap my code, all nicely formatted and enclosed in a sweet JavaScript drop down container. Nice.
However, it turns out I need to come back to my post at some point in the future and make a slight change, perhaps correct a spelling mistake? So I load up my post editor, visual editor selected by default and bam all my lovely formatted code wrapped in my sexy dirtycode tags has now been completely borked. What gives WordPress? Why can’t you leave my code alone and let me get on with things the way “I” want to do them…?
**UPDATE**
So I manage to keep the <dirtycode> tags in my post, but now the next time I go to edit, whether in the HTML editor or not, WordPress decides it is going to add<p> & <br /> tags all over the place. What makes this worse is dirtycode (obviously) renders them as pure code so I end up with a load of unwanted tags all over my code snippet. Im still fighting with this. Grrr.
Ok, rant over. Now does anyone have any answers? I know this is not an uncommon issue and there must be ways around this without hacking up the tinyMCE settings. I guess for now I will write up my posts first, adding the wrapped code at the end and never touch it again until this issue is fixed! That, or just use the HTML editor…. hmm.



0 Responses to “WordPress HTML Editor Annoyances”