Crayon code is generated for every post
-
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:
- Change the default to False for new installs
- Add a documentation link to explain what this option does and why you might want to use it
Thanks and best regards,
Andrew.
http://ww.wp.xz.cn/extend/plugins/crayon-syntax-highlighter/
The topic ‘Crayon code is generated for every post’ is closed to new replies.