Everything is perfect if I use only html view. If I decide to go back to design view, tinyMCE apparently changes
tag so that i have: <pre class="php"> insted of <pre name="code" class="php"> which results in code highlight not being activated.
Everything is perfect if I use only html view. If I decide to go back to design view, tinyMCE apparently changes
tag so that i have: <pre class="php"> insted of <pre name="code" class="php"> which results in code highlight not being activated.
I have exactely the same problem and could not find a solution yet.
Please, anyone may post a solution...
... but it seems, the "striping" isn't done by tinyMCE, because I alsready deactivated *AND* deleted it. Behaviour is still the same.
<PRE NAME="code" CLASS="php">
results in:
<PRE CLASS="php">
Sad thing...
One more thing:
It works, if you enter the <PRE NAME... thing in HTML editing mode, hit 'Save Draft' and preview your post. That totally works!
But once you switch to Visual editing mode, the NAME="code" part disappears immediately.
Solution needed...
and, if you have wp-print installed - it kinda breaks whole concept, because, if i have in [pre] html, wp-print module executes it instead of showing the code.
possible solution would have been an ability to put something like [code=php]
in visual editor and plugin would parse it as necessary.
You can use extended_valid_elements in tinyMCE init and include pre[name] in the element list you can also add number of attribute in it like name, language etc.
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
extended_valid_elements : "pre[name|language]"
});
I have modified it work on wordpress visual mode.
http://www.satya-weblog.com/2009/09/google-syntax-highlighter-for-wordpress.html
You must log in to post.