[Plugin: Google Syntax Highlighter for WordPress] tinyMCE strips {name='code'} part when going to de (8 posts)

  1. banesto
    Posted 7 years ago #

    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.
  2. thomasgericke
    Posted 7 years ago #

    I have exactely the same problem and could not find a solution yet.

    Please, anyone may post a solution...

  3. thomasgericke
    Posted 7 years ago #

    ... 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...

  4. thomasgericke
    Posted 7 years ago #

    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...

  5. banesto
    Posted 7 years ago #

    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.

  6. banesto
    Posted 7 years ago #

    possible solution would have been an ability to put something like [code=php]
    in visual editor and plugin would parse it as necessary.

  7. narasingh4u
    Posted 7 years ago #

    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.

    // General options
    mode : "textareas",
    theme : "advanced",
    extended_valid_elements : "pre[name|language]"

  8. Satya Prakash
    Posted 6 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic