WordPress.org

Ready to get started?Download WordPress

Forums

Crayon Syntax Highlighter
Crayon + Objective-c not working as it should (8 posts)

  1. kozze89
    Member
    Posted 2 years ago #

    I have tried out crayon with Java and Bash which seem to work. However when I try to show some objc code I get this: http://i45.tinypic.com/2i935le.png

    Any ideas why?

    http://wordpress.org/extend/plugins/crayon-syntax-highlighter/

  2. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Could you post the HTML post text?

  3. kozze89
    Member
    Posted 2 years ago #

    Hi akarmenia, After testing a bit more on this it seems like it is not connected to objc specifically. Actually I am having problems telling when the error occurs. Right now most of the times it works... I had problems mostly when previewing the post when editing.

    I know this doesn't say much. I am going to continue trying and I will post any updates here if I can find a pattern for the problem!

    Btw, great plugin I love it! Keep up the good work :)

  4. kozze89
    Member
    Posted 2 years ago #

    I found another problem that might be of interest to you as well:

    Using crayon like this:
    <pre class="lang:objc decode:true " >@interface ViewController : UIViewController <UIWebViewDelegate>

    Results in this after saving:
    <pre class="lang:objc decode:true " >@interface ViewController : UIViewController <uiwebviewdelegate></uiwebviewdelegate>

    Seems to think that uiwebviewdelegate is a html tag and closes it.
    Any ideas why? Or how to solve this?

  5. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for your support, glad you like it. Did you close the pre afterwards? I imagine so, and I think that's caused by TinyMCE treating that protocol as an HTML tag. You can prevent that by using the HTML editor after creating the Crayon, but I'll look into it.

  6. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    You should not use the "<" character inside the pre, since it will be an actual XHTML element. The Tag Editor should create them as "& amp;lt;" and then decode it when printing it on the web page.

  7. kozze89
    Member
    Posted 2 years ago #

    I am actually using the "<" character!

    When I tried it on a new post that I created it worked, but when I try to do it to an old post I still get the problem mentioned above.

  8. akarmenia
    Member
    Plugin Author

    Posted 2 years ago #

    All angular brackets should be encoded as html entities in the Crayon, and the decode:true option must be used to decode them before highlighting. You shouldn't have a decoded angular bracket in the code, because it will treat it as an HTML tag:

    Good:
    https://dl.dropbox.com/u/33811812/Crayon/support/ang1.png

    Bad:
    https://dl.dropbox.com/u/33811812/Crayon/support/ang2.png

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic