Code for Fun!!

Leave a Reply

Comment as a guest.

  1. I don’t see how I can help Manuel, there’s nothing broken in iG:Syntax Hiliter! The problem is with SmartyPants that it doesn’t gives the option to specify custom tags which it can skip while beautifying the rest of the quotes. 🙂

    If you mean to suggest that I use the <code> tag for the hilighting purposes then that would mean making a big mess as a lot of people(including me) are already using the BB Code style tags for this plugin!

    You can however modify the plugin for your own purposes, have it use <code> tag(like <code lang=”php”>) instead of BB Codes so that way you won’t have to put in <code> tag everytime manually. Or you can modify the quicktags for this plugin & put in <code> tag there so that you just click the quicktag button & the <code> tag will appear without you having to write it! 🙂

  2. I just figured out the problem many users have with this and other code highlighting plugins while writing code in visual/WYSIWYG mode (e.g. see comment by alexis above about the “>” problem). I made a simple hack for the same(link). Take a look

  3. Manuel, you can do it yourself by editing the line #203 which is this:
    [php num=203]
    $inData = preg_replace_callback(‘/[(w{1,})((?:s+num+=([0-9]{1,})+)*)](.+?)[/1]/ims’, ‘igSynHilite_code’, $inData); // call code hiliter
    [/php]
    Its a plain RegEx call, you can edit it so that it takes the code from between your desired tags instead of the BB Code tags that it takes currently. 🙂

    Shantanu, its been said over & over again that if code is to be posted while using this plugin then the WYSIWYG editor is not be used, its also mentioned in the Plugin Manual. It becomes a sad story when people don’t read it at all & start filing reports for problems when there are none! 🙂

  4. Yeah, I feel you man about the issue of people not reading things and posting the same question again and again, even if you post it in a size 20 font 🙂
    But still I made the hack cuz I found it a bit problematic to maintain my posts with the WYSIWYG limitation.

  5. Cheers Amit, but i decided to not use smartypants/typogrify any longer. I usually pay attention while typing (i used the plugin more like a safety net) and add non breaking spaces between the last three (instead of two) words, so i bet smartypants/typogrify was bored already anyways 🙂

    One thing i can not nail down though, is that sometimes my IG:Syntax settings seem to be re-setted, but i can not tell yet what is causing this. Got a clue?

  6. Hey, just got an idea. You can provide this as an option in the plugin. I mean whether the user wants to use WYSIWYG or not. The hack can then be wrapped around in an if() that checks for the option.

  7. @Manuel:

    One thing i can not nail down though, is that sometimes my IG:Syntax settings seem to be re-setted, but i can not tell yet what is causing this. Got a clue?

    Some people have reported this issue that when they activate other plugins then this one’s settings are reset while others have reported that its working fine for them. I tried it out on 3 versions of WordPress in my sandbox & wasn’t able to re-generate this problem. So really can’t help there at the moment! 🙁

    @Shantanu:
    Yeah but like I said, its a one-way street. Once you’ve used it then you will have to use it always. Like if I write code in WYSIWYG in 2 posts & then later I decide not to use WYSIWYG(or vice versa) then my earlier code will be screwed!! Then for that a seperate value per post will have to be saved to mark if that post was done in WYSIWYG or not.

    The reasoning behind not using WYSIWYG was that anyone who uses this plugin is a programmer(don’t think any non-programmer has any use for this plugin) & hence they shouldn’t have problems using non-WYSIWYG interface since the quicktags toolbar that’s there in non-WYSIWYG interface is pretty cool too & makes up for the WYSIWYG interface & besides, the WYSIWYG interface produces ugly HTML!! 😉

  8. @Amit:
    1. Its not necessarily a one-way street. Depends on how we implement it. If you don’t want to update it, can I distribute a modified version? All other aspects of it will remain intact like its name, its author’s name etc. Might include a one line of “modified by me” though. But all this only if you don’t plan to include this feature, and you approve of modification. If you don’t then also I understand.

    2. About the reasoning of only programmers using this plugin, I agree but:
    a. It might also be used by people who have never coded in html, etc but code in other languages.
    b. Now, html is not so hard and even if one knows it, it might be a bit of pain and waste of time to do everything by hand always.
    c. People might be using offline clients to post (like me), where using the WYSIWYG mode also means that you don’t need to upload any files, images etc separately, the client takes care of that. moreover, writing the same piece of custom inline css etc can also be taken care of in this mode.

  9. Is there a way to set the different options uniquely for each code-elemnt? This would be similar to specifying the starting line number, but for the other options such (Show Language Name, etc.).

    This would be very nice to have.

    And thank you for a very nice plugin!
    It’s so easy to add other language files… just fantastic.

  10. The PHP chr() function breaks this plugin.

    I just spent 30 minutes trying to figure out what was going on until I discovered that I cannot post any code that contains chr().

    If someone could post a fix, that would be awesome.

    I also suffer from the resetting of options every time the plugin is disabled/re-activated (during WP upgrades for example). Otherwise, this is a great plugin! Thanks Amit!

  11. I guess I posted too soon! It doesn’t appear to be a problem with this plugin, but rather with WordPress 2.3.3! I just tried upgrading another blog to 2.5 and the problem doesn’t occur.

  12. @Michael:

    Is there a way to set the different options uniquely for each code-elemnt? This would be similar to specifying the starting line number, but for the other options such (Show Language Name, etc.)

    No, I’m afraid there’s no way to do that right now! Might look into this for next version! 🙂 Thanks for liking the plugin! 🙂

    @Raam:
    Its ok, mistakes can happen with anyone! 🙂

  13. Hi.

    How can i reduce the width of the code box of iG:Syntax Hiliter ???

    I try to modify value of css but it don’t have efect.

    I think it will may be a option in control panel.

    Thanks

  14. Is posible exclude some words?
    there is a plugin that i need, that use the same kind of symbols
    [name] …. [/name]
    So, because of that, while i’m using hiliter, i can’t use the other plugin.
    Thanks….

  15. @patricia:
    If you are using v3.5 of the plugin, you don’t have to worry about this issue. Except the tag names for the included language files, if you use any other tag name then the plugin will check if that particular language file is available or not. If its not available then the plugin won’t parse that text as you can see yourself here that the plugin has not parsed the [name] tag that you put in the comments! 🙂

Sliding Sidebar