WordPress.org

Ready to get started?Download WordPress

Forums

Crayon Syntax Highlighter
[resolved] Crayon code is generated for every post (2 posts)

  1. Andrew Biss
    Member
    Posted 1 year ago #

    Hi,

    I was expecting that only the posts that contained Crayon shortcodes or <pre> tags would add the Crayon CSS, HTML and Javascript into the generated source. In practice it looked like the Crayon code was being generated into every post on my site.

    My first thought was the Misc option Attempt to load Crayon's CSS and JavaScript only when needed. Some testing showed that even when I enabled this option I was still getting code added to every post on the site.

    Rather, the extra code was being generated because the Tag Editor option Display the Tag Editor in any TinyMCE instances on the fronted was defaulting to True. I disabled this option and the Crayon code was now only generated for posts which actually needed syntax highlighting, which is naturally a lot more efficient.

    For reference I now have these settings:

    • Attempt to load Crayon's CSS and JavaScript only when needed = True
    • Display the Tag Editor in any TinyMCE instances on the fronted = False
    • Display Tag Editor settings on the frontend = False

    My question is whether or not it's a good idea to default the Display the Tag Editor in any TinyMCE instances on the fronted option to True for a fresh install?

    How many people trying out this plugin are going to have TinyMCE instances in their front-end posts which need syntax highlighting support?

    My suggestions:

    1. Change the default to False for new installs
    2. Add a documentation link to explain what this option does and why you might want to use it

    Thanks and best regards,

    Andrew.

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

  2. akarmenia
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks Andrew, that's a good idea. I had that setting to true because for most people getting it to work is more important than making the site more efficient (while both are very important!). However, since the tag editor needs more resources (fancybox being one) I agree it's a better idea to disable it for new installs and mention it in the documentation.

    http://ak.net84.net/crayon/crayon-with-bbpress/

    I've disabled it by default in the latest 1.15 beta release.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.