Forums

problems with php code highlight (5 posts)

  1. olederer
    Member
    Posted 5 years ago #

    Hello,
    I think I tried all existing code highlight plugins but with all of them I have the same problem:

    php code like this is parsed by WP 2.04 as html and not als highlighted code:


    foreach ($parent_array as $pkey => $pval) {
    if (!empty($pval['count'])) {
    $menu .= "
    <li><a>".$pval['label']."</a></li>
    n";
    } else {
    $menu .= "
    <li><a>".$pval['label']."</a></li>
    n";
    }
    }

    EDIT: check this image that shows the code, Why? because I have the problem at this blog too!

    the problems are with list items which are becomming list items other PHP code is parsed well (never has this problem in regular php powered websites).

    Which WP filter need be changed? (without loosing protection)?

  2. olederer
    Member
    Posted 5 years ago #

    Just noticed that code with backticks is parsed right but what if I need code coloring ? and why is teh href attribute changed into xhref?

  3. olederer
    Member
    Posted 5 years ago #

    Hello,

    is there no one with this problem?
    It looks to me that this is a 2.04 problem...

  4. moshu
    Member
    Posted 5 years ago #

    The majority of WP users are not interested in posting code.
    If you think it's a genuine bug - this is the place to report it: http://trac.wordpress.org/

  5. olederer
    Member
    Posted 5 years ago #

    Hello Moshu,
    I don't wanna post code but want to comment code in my blogs.

    So if I need to parse code in my blog site I need to use a diff. blog software?

    Edit: by the way its possible to post code via the wordpress hosted blog site...

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags