Forums

wp-syntax pre tag vanishes.. sort of... (9 posts)

  1. jayman76
    Member
    Posted 4 years ago #

    I added the wp-syntax plugin, activated it, and copied/pasted the sample within the write->post->code section (as opposed to visual). This is the code:

    <pre lang="php">
    <div id="foo">
    <?php
      function foo() {
        echo "Hello World!\\n";
      }
      for (\$i = 0; \$i < 10 $i++) {
        foo();
      }
    ?>
    </div>

    After save those lines are reducded to:
    <pre></pre>
    and obviously it doesn't work.

    What am I missing?

  2. jayman76
    Member
    Posted 4 years ago #

    hmmm... the first block of code did a closing pre tag and it was reduced to just an open and close pre tag with none of the tag settings or the code in the middle.

  3. rmm5t
    Member
    Posted 4 years ago #

    jayman, Hi. The original code snippet is missing the end </pre> tag. I'm not sure I understood your follow-up post. Could you please ellaborate?

  4. Chris_K
    Member
    Posted 4 years ago #

    (I fixed your formatting in first post)

  5. rmm5t
    Member
    Posted 4 years ago #

    jayman, What role are you writing your posts under (admin, editor, author, etc)? There's a known issue with the wp-syntax plugin that I haven't yet spent any time on. When writing as an "author," all attributes of and all output between <pre> tags are stripped during a save.

    There is currently an open ticket regarding this issue.

  6. jayman76
    Member
    Posted 4 years ago #

    I'm posting as the admin for the blog. Still haven't figure this out... with all the cool plugins and themes out there fore WordPress i've been busy :) would love to get this work!

  7. rmm5t
    Member
    Posted 4 years ago #

    jayman76, If you're posting as an admin, and have followed the nuance instructions on the FAQ, then I'm a bit baffled.

  8. lupinek
    Member
    Posted 4 years ago #

    Same problem. Can anyone help??
    any attributes like <code XXX=""> or <pre XXX=""> are deleted while saving post :/ so the plugin can't work properly.

    I tried also other highlighting plugins, so I think that the problem is with WP editor.

  9. rmm5t
    Member
    Posted 4 years ago #

    Try editing code snippets without the visual editor. To turn off the visual editor for all your edits, uncheck the visual editor checkbox in your profile. Depending on what type of code you're trying to display, you might also need to disable WordPress' corrections of invalidly nested XMTML (under Options -> Writing).

    If this doesn't work, what other plugins are installed? What user level are you posting as?

Topic Closed

This topic has been closed to new replies.

About this Topic