WordPress.org

Ready to get started?Download WordPress

Forums

SyntaxHighlighter Evolved
Illegal filtering of generic java code tokens (2 posts)

  1. ollio
    Member
    Posted 1 year ago #

    Thanks for this great plugin, it's great for attrative and readable code rendering.
    Using Version 3.1.3 of the plugin, I stumpled into an issue:

    [sourcecode language="java"]
    public class Aggregator <T> {}

    is rendered to

    public class Aggregator {}

    and thus mutilated to meaninglessness

    the generic codetoken <T> is filtered away. I know can easily be interpreted as HTML-Syntax, but here it is part of legal java syntax.

    It may be of interest, that after updating the wordpress post, the -Tag is removed from the text alltogehter.

    Generic syntax came up with Java 1.5, can you please make a statement of compatility of the plugin and the supported java syntax versions.

    When I try to use HTML-Escape tokens like < > the code

    public class Aggregator < >

    is still rendered to

    public class Aggregator

    the HTML escapes tokens are not displayed, but survive at least in the source text without being removed by any obsure hidden filtering. This is suggested as solution by
    http://codex.wordpress.org/Writing_Code_in_Your_Posts should generally help, but it fails here.

    You can check the erronous rendering at my blog at:
    http://www.knowledgeware-consulting.ch/java/generic-types-and-generic-algorithms

    My idea of a syntax highligther is that of any coder. Code should be taken as literal text. No programm tokens should vanish. Only color formatting should be added. No extra preprocessing of the code should be necessary. The coders reputation should not be ruined by an syntax highlighter, that conseals some program tokens....I know this is no easy issue, interaction between wordpress renderer and the input and rendered output of the plugin may become quite complex.

    Can you please resolve this issue.

    Kind regards

    Othmar Lippuner

    PS: Sorry I now this is a nitty-gritty issue. I experienced it myself when writting this text here. At had to joggle quite a bit with these HTML escapes ;-) at least it's not filtered out here....

    http://wordpress.org/extend/plugins/syntaxhighlighter/

  2. ollio
    Member
    Posted 1 year ago #

    I further insisted on the issue above and found out a way to force correct rendering. You need to enclode the [plugin-directives [sourcecode language=".."] ....[/sourcecode] with a Code-Tag, like

    HTML-Code_element
    [sourcecode language="css"]
    your code here
    [/sourcecode]
    eof-HTML-Code_element

    </p>
    <p>Anyhow the wp-user's guide in
    http://en.support.wordpress.com/code/posting-source-code/
    doesn't declare this need correctly.</p>
    <p>A permanent more stable solution should be negotiated between WordPress-Team and Alex as author of this outstanding plugin.</p>
    <p>kinde regards</p>
    <p>Othmar Lippuner`

    PS: HTML-Code_element should be a HTML-Element CODE in angle brackets. But it can't write it here!! It's a bit a pain .....

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic