• 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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter jayman76

    (@jayman76)

    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.

    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?

    (I fixed your formatting in first post)

    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.

    Thread Starter jayman76

    (@jayman76)

    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!

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

    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.

    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?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘wp-syntax pre tag vanishes.. sort of…’ is closed to new replies.