Plugin Directory

Crayon Syntax Highlighter

Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.

1.9.6

  • Fixed a bug causing wordpress wp_content path customisations to break the tag editor and live preview
  • Fixed a bug with marked lines using ranges

1.9.5

  • Fixed a bug that prevent Crayons from being captured internally, only affected on certain themes
  • Fixed a bug causing backquotes being changed to code within Crayon code

1.9.4

  • Added /util/external_use.php for an example of how to use Crayon in other PHP environments.
  • Fixed issues with the excerpt, now Crayons are not stripped out by default, can be changed in Settings > Misc.
  • Fixed font-size issues that may conflict on some themes.
  • Crayons in comments now have their HTML entities decoded by default, specify "decode:false" in the class attr or decode="false" as an attr if you don't want it to decode.
  • Fixed a newline bug thanks to Eugene at http://iteye.ru/

1.9.3

  • Added Perl
  • Minor bugs fixed thanks to http://hahler.de
  • Fixed bug in js detecting PCs as Macs
  • Fixed IE bug preventing code from opening in a window
  • Fixed bug causing comment <p> tags being removed

1.9.2

  • Fixed an error preventing code containing HTML tags from being added using the Tag Editor in Visual mode
  • Fixed CSS for Mixed Highlighting (+)
  • Added a new theme thanks to http://blog.phiphou.com

1.9.1

  • Added Assembly (x86)
  • Standardised the toolbar buttons, now they use CSS spriting and have the same colour
  • Changed Theme CSS background to avoid conflicts with themes that affect TD tags
  • Fixed bug caused by discrepancies in how checkbox values were handled in Tag Editor
  • Fixed a bug causing $root variable to change on some setups, preventing tag editor from loading

1.9.0

  • This update is the biggest update yet - highly recommended for all users.
  • Added a brand new Tag Editor in the Visual Editor toolbar! Greatly simplifies adding code to posts in the Visual Editor. You can also switch between Visual and HTML modes to verify your code before posting!
  • Added ability to decode HTML entities, so now you can use <, > etc. in the Visual Editor. But if you need indentation etc, you'll want to use the HTML editor for posts with Crayons. You can also use decode="yes/no/true/false" to set this for an individual Crayon.
  • Added ability to decode attributes, which is enabled by default to avoid seeing encoded strings in the title, and also to allow encoded angle/square brackets in the title that would otherwise clash with the Crayon tag brackets if left unencoded.
  • Added ability to use the class attribute in <pre> tags for specifying settings like url, mark, lang, toolbar and all other valid settings like in a normal [crayon] tag. This will ensure your <pre> tags remain valid XHTML markup even with Crayon disabled.
  • Added ability to specify hyphen-separated-values in the class attribute of a <pre> tag to make them look like actual class selectors. E.g. <pre class="lang-objc toolbar-false">...</pre>. The setting name is made up of letters and hyphens ONLY, the value is whatever is left between the last hyphen and the next whitespace character.
  • Added Scheme language thanks to https://github.com/harry75369
  • Added ABAP language with help from Christian Fein
  • Added a new setting: crayon="false/no/0" as an attribute or crayon:false in the class tag of a <pre>. This will ignore the <pre> tag and not turn it into a Crayon for those rare cases you don't want to use the plugin.
  • Improved the method of finding posts with Crayons - now it will search through all posts for Crayons and save the ids in the options db. When the_posts is called, it won't need to do any extra searching on page loading and will already know which post has Crayons. Like before, pages which might use page templates will turn off enqueuing of fonts and themes to ensure they are always printed.
  • Overriden Language File elements are now put first in the CSS class name, so the extended element can override in a theme
  • Prevented capturing Crayons in the admin
  • Crayons now use HTML5 valid markup
  • I'm still sticking to the wrap="off" for no-wrapping preformatted styling - CSS doesn't do the trick yet: http://stackoverflow.com/questions/657795/how-remove-wordwrap-from-textarea
  • Improved ajax handling
  • Cleaned up the settings screen
  • Line numbers now use UID in id to avoid duplicates
  • Crayon CSS updated to use inline styles and never use style tags in the body
  • Simplified the toolbar buttons to suit the minimalistic design of the rest of Crayon. It'll look badass with an inset shadow in a future theme...
  • Plain tags are now just <pre> tags and don't contain the inline code tag since they are block tags.
  • Fixed a MAJOR bug preventing previously captured Crayons from being applied to post content!
  • Fixed a bug causing case insensitive Boolean settings to fail at times
  • Fixed a bug causing a [crayon ... /] tags to be recognised as [c ... /] tags (added a \b)
  • Fixed a bug preventing highlight="false" from working
  • Fixed a bug preventing mouse events for showing plain code when toolbar is always hidden
  • Fixed a bug preventing smart enqueuing from detecting if a Crayon was present before enqueuing resources.
  • Fixed a bug causing inline tags to be surround in <p> tags
  • Fixed a bug causing toolbar=1 to be regarded as toolbar=false from legacy settings
  • Fixed a bug causing content to be specified but not formatted for URLs with no code given
  • Fixed removing $ in font of ignored crayons like $<pre...
  • Fixed js .style bugs in < IE 9
  • Cleaned up code for specifying attributes, NULL attributes are not passed as empty strings anymore.
  • The log looks cleaner now
  • Now crayons are replaced with [crayon-id/] in posts before being replaced with the actual Crayon
  • If js ever fails to load, it won't affect styling, just functionality
  • Added ability to use closed Mini Tags like [php ... ] when you're just giving a URL
  • Added lenient spaces for closed tags
  • Fixed element content text in XHTML to avoid capturing "" as strings
  • Added Lithuanian translation thanks to Vincent G

1.8.3

  • Added inline support for Crayons using the inline="true" attribute or even cooler with {php}...{/php} style tags.
  • backquotes become <code>
  • Added support for Crayons in comments!
  • Added Apache
  • Fixed a bug causing irregular formatting of Crayons by increasing the priority of the_content filter, thanks to http://joshmountain.com/
  • Added sample code for missing languages in Live Preview

1.8.2

  • Added AutoIt and PowerShell
  • Fixed a bug causing single line comments on the last line without carriage return to be ignored.
  • Fixed bug causing crayon.js to fail when show-plain-default was enabled thanks to http://www.stuarticus.com/

1.8.1

  • Added Lua
  • Added YAML
  • Added different highlighting for preprocessor in C, C++, C# and Obj-C. Any other lang can use it as well.
  • Improved Russian translation thanks to Di_Skyer (http://atlocal.net/)
  • Added new "Neon" theme thanks to Di_Skyer (http://atlocal.net/)
  • Added ability to log debug messages if CRAYON_DEBUG is TRUE in global.php
  • Added ALLOW_MIXED = YES/NO option in language files to disable ability to have mixed language highlighting

1.8.0

  • Added PostgreSQL thanks to Emiliano Leporati and Alessandro Venezia from http://bitorchestra.com/
  • Added ActionScript
  • Thanks to Thomas Tan for finding and fixing IE6 compatibility bugs in crayon.js!
  • Improved Objective-C, XHTML and default language
  • ?alt: tag now supports spaces in language files, treats then as \s+
  • Added support for single quotes in CSS and JS

1.7.30

  • Added Inventor iLogic as a language
  • Added cellspacing and cellpadding back into table due to spacing issue after trying to conform to W3C standards...
  • Improved default language constants
  • Added missing language samples for live preview (ruby, monkey and ilogic)
  • More prominent "show language" button

1.7.29

  • Thanks to @west_323 for updating the Japanese translation

1.7.28

  • Fixed a bug prevent attributes from being detected since 1.7.24
  • Added Turkish languge thanks to Hakan (http://kazancexpert.com)

1.7.27

  • Recommended update for everyone. This fixes a bug in 1.7.25 where Mixed Highlighting would fail inside an html tag
  • Greatly simplified the mixed highlighting method, more robust
  • Made it impossible to nest delimiters, which mimics the behaviour in supported languages.

1.7.26

  • Added translations to the tooltips and copy notification in the toolbar

1.7.25

  • German translation improved by Stephan Knauß;
  • Added missing translations in other languages and fixed bug preventing dropdowns from being translated
  • Added translators to the about page
  • Oh, added <html>...</html> tag into the delimiters
  • But of course, if you wanted say HTML with PHP, then you'd set the language to HTML and use <?php ... ?> tag when you needed them

1.7.24

  • Added support for Ruby(on Rails)?
  • Added support for Ruby file extensions like rb, rbx
  • Added "rb" alias for [rb][/rb] Mini Tags
  • Added RHTML delimiters like %lt;% and %%gt;
  • Added a bottom margin to the Plain Tag
  • Added support for quotes in the title attribute
  • You still need to use " some 'title'" or ' some "title" ' properly, not "' or '" ;)

1.7.23

  • Remove 'theme-font' and replaced default as 'Monaco'.
  • Remove @import for fonts and replace with CSS tags. This should fix any 404 issues.
  • Now all fonts reside in /fonts with font-face fonts having a separate directory by their name to store the font vectors etc

1.7.22

  • Fixed dimension and redraw issues on scrollbars

1.7.21

  • Fixed a bug that relied on register_activation_hook to update the database on auto update

1.7.20

  • "Always display scrollbars" now a checkbox

1.7.19

  • Fixed issue with Crayons failing to load on pages with templates containing The Loop. http://bit.ly/AcWRNY
  • Objective-C operators improved

1.7.18

  • Fixed issue with extra <br/> and <p> tags before and after Crayons

1.7.17

  • Added a setting to use just the main WP query or to use the_posts wherever it is used (default now).
  • Improved XHTML

1.7.16

  • Running out of revision numbers!
  • Fixed a bug causing default-theme from loading as a font
  • Fixed an issue where the js used to remove inline styles before opening in another window was missing the /g regex modifier
  • Cleaned up loading and event handling in crayon.js
  • Fixed a bug causing code popup to fail
  • Improved CSS language
  • Improved JS language by adding regex syntax, yay!
  • Fixed issues with resizing Crayon and dimensions
  • Added support for custom excerpts

1.7.15

  • Fixed a bug prevented fonts and themes with spaces from being enqueued. Thanks to Fredrik Nygren.
  • Improved handling of id's and names of resources.

1.7.14

  • Fixed a bug that could potentially cause a PHP warning when reading the log when not permitted to do so.

1.7.13

  • Fixed a bug causing my settings and donate links to be appended to all plugins in the list. Thanks to Ben.

1.7.12

1.7.11

  • Added the option of either enqueuing themes and fonts (efficient) or printing them before the Crayon each time when enqueuing fails
  • Thanks to http://www.adostudio.it/ for finding the bugs
  • Improved theme and font handling
  • Improved theme detection and Crayon capturing

1.7.10

  • Fixed a visual artifact of loading that caused the plain code to be partially visible

1.7.9

1.7.8

  • Fixed a JavaScript bug in admin preventing language list loading
  • Fixed an issue causing plain code to load invisible the first time if set to default view
  • Added translations for 1.7.7 features

1.7.7

  • Added plain code toggling and ability to set plain code as default view
  • Minor improvements to Objective-C
  • Fixed some JavaScript bugs in the admin preview
  • Fixed copy/paste key combinations. Thanks to http://wordpress.org/support/profile/nickelfault.

1.7.6

  • Added highlight support for catching multiple exceptions in Java

1.7.5

  • Removed jQuery.noConflict() from crayon.js. This must have been causing some trouble if anything used $.

1.7.4

  • Added namespacing to crayon.js to prevent conflicts

1.7.3

1.7.2

  • Fixed a bug that prevented foreign languages from being initialised and used. Thanks to @west_323 for finding it.

1.7.1

  • Renamed Japanese GNU language code from ja_JP to ja.

1.7.0

  • Added the ability to highlight multiple languages in a single Crayon! http://bit.ly/ukwts2
  • A bunch of language improvements, a few CSS improvements, etc.

1.6.6

  • Fixed a bug causing international Unicode characters being garbled in the title (thanks to simplelib.com!)
  • Fixed a bug that prevented strings from being highlighted

1.6.5

  • Fixed a bug causing international Unicode characters being garbled

1.6.4

  • Added user submitted Japanese language support. Thanks to @west_323!
  • <pre></pre> tags are now captured as Crayons. This can be turned off in Settings > Crayon > Code.
  • You can remove prevent capturing individual <pre> tags the same way as Crayons: $<pre> ... </pre>
  • This method of preventing the <pre> tag should be used if your code contains <pre> tags (nested <pre> tags) - otherwise it will cause conflicts.
  • Keep in mind that <pre> tags should not be editted in Visual Mode. Crayon will display all code as it appears in the HTML view of the post editor, where you can make code changes and use the tab key etc. If you want to use the Visual editor reguarly and are running into problems, consider loading the code form a file using the 'url' attribute.
  • I have removed the ability to have spacing between the starting and ending square brackets, so [crayon...] is valid but [ crayon ... ] is not. The same applies to <pre> tags (not < pre >). The reason is to improve performance on posts without Crayons by using strpos and not regex functions like preg_match, and also it's better formed.
  • Fixed a bug causing Plain Code to display characters as encoded HTML entities
  • Removed jQuery 1.7 from /js folder. Now uses the version provided by WP.

1.6.3

1.6.2

  • Added ability to use and define language aliases. eg. XML -> XHTML, cpp -> c++, py -> python

1.6.1

  • Avoided using $wp_query, $posts instead
  • Updated contextual help to be compliant with WP 3.3

1.6.0

  • Added internationalisation with 4 new languages: German, Spanish, French and Italian
  • These were translated using Google Translate, so if you speak these languages and would like to improve them, it's actually quite easy to edit - just contact me via email :)
  • More languages will be added as they are demanded

1.5.4

  • Recommended update for everyone
  • Fixed a bug that caused the default theme not to load if was anything but "classic" - Thanks to Ralph!

1.5.3

  • Fixed issue with incorrectly specified theme causing crash
  • Email Developer improved

1.5.2

  • Proper enquing of themes via wordpress, should cause no more issues with any themes
  • Cached images for toolbar items, no delay on mouseover
  • Fixed a minor regex bug in js preventing styles from being removed when in popup

1.5.1

  • Fixed plain code toggle button update

1.5.0

  • Added ability to cache remote code requests for a set period of time to reduce server load. See Settings > Crayon > Misc. You can clear the cache at any time in settings. Set the cache clearing interval to "Immediately" to prevent caching.
  • Fixed a bug preventing dropdown settings from being set correctly
  • Fixed AJAX settings bug
  • Fixed CSS syntax bug for fonts
  • Improved code popup, strips style atts
  • Added preview code for shell, renamed to 'Shell'
  • Code popup window now shows either highlighted or plain code, depending on which is currently visible

1.4.4

  • Revised CSS style printing
  • Fixed bugs with the "open in new window" and copy/paste actions
  • Upgraded jQuery to 1.7

1.4.3

  • Fixed a bug that caused the help info to remain visible after settings submit

1.4.2

  • Huge overhaul of Crayon detection and highlighting
  • IDs are now added to Crayons before detection
  • No more identification issues possible
  • Highlighting grabs the ID and uses it in JS
  • Only detects Crayons in visible posts, performance improved
  • This fixes issues with

1.4.1

  • Fixed Preview in settings, wasn't loading code from different languages
  • Fixed code toggle button updating for copy/paste
  • Added some keywords to c++, changed sample code

1.4.0

  • Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
  • Fixed issues with variables and entites in language regex
  • Added Epicgeeks theme made by Joe Newing of epicgeeks.net
  • Help updated
  • Fixed notice on missing jQuery string in settings
  • Reduced number of setting reads
  • Setting name cleanup
  • Added a donate button, would appreciate any support offered and I hope you find Crayon useful
  • String to boolean in util fixed

1.3.5

  • Removed some leftover code from popupWindow

1.3.4

  • Added the ability to open the Crayon in an external window for Mobile devices, originally thought it wouldn't show popup

1.3.3

  • Added the ability to open the Crayon in an external window

1.3.2

  • Added missing copy icon

1.3.1

  • This fixes an issue that was not completely fixed in 1.3.0:
  • Removed the lookbehind condition for escaping $ and \ for backreference bug

1.3.0

  • Recommended upgrade for everyone.
  • Major bug fix thanks to twitter.com/42dotno and twitter.com/eriras
  • Fixed a bug causing attributes using single quotes to be undetected
  • Fixed a bug causing code with dollar signs followed by numbers to be detected as backreferences and replace itself!
  • Fixed a bug causing formatting to be totally disregarded.
  • Fixed the tag in post_content and the_excerpt by placing crayon detection after all other formatting has taken place
  • Added copy and paste, didn't use flash, selects text and asks user to copy (more elegant until they sort out clipboard access)
  • Added shell script to languages - use with lang='sh'
  • Removed certain usage of heredocs and replaced with string concatenation
  • Added 'then' to default statements
  • Cleaned up processing of post_queue used for Crayon detection and the_excerpt
  • Added focus to plain text to allow easier copy-paste

1.2.3

1.2.2

  • Fixed the regex for detecting python docstrings. It's a killer, but it works! (?:(?<!\)""".?(?<!\)""")|(?:(?<!\)'''.?(?<!\)''')|((?<!\)".?(?<!\)")|((?<!\)'.?(?<!\)')

1.2.1

1.2.0

  • Recommended upgrade for everyone.
  • Fixed crucial filesystem errors for Windows regarding filepaths and resource loading
  • Said Windows bug was causing Live Preview to fail, nevermore.
  • Fixed loading based on URL structure that caused wp_remote errors and local paths not being recognised
  • Removed redundant dependency on filesystem path slashes
  • PHP now fades surrounding HTML

1.1.1

  • Plugin version information is updated automatically

1.1.0

  • Recommended upgrade for everyone running 1.0.3.
  • Fixes a bug that causes code become unhighlighted
  • Attribute names can be given in any case in shortcodes
  • Fixes settings bug regarding copy constructor for locked settings
  • Minor bug fixes and cleanups

1.0.3

  • Added highlight="false" attribute to temporarily disable highlighting.
  • Fixed default color of font for twilight font.

1.0.2

  • Minor bug fixes.

1.0.1

  • Fixed a bug that caused Themes not to load for some Crayons due to WordPress content formatting.

1.0.0

  • Initial Release. Huzzah!

Requires: 3.0 or higher
Compatible up to: 3.3.2
Last Updated: 2012-5-18
Downloads: 23,011

Average Rating

4 stars
(43 ratings)

Support

1 of 1 support threads in the last three weeks have been resolved.

Got something to say? Need help?

Compatibility

+
=
Not enough data

4 people say it works.
0 people say it's broken.

100,1,1
100,1,1 100,1,1 50,2,1 100,1,1 100,1,1 100,1,1 100,1,1 100,3,3 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,1,1
100,1,1 100,2,2 100,2,2 100,1,1 100,1,1 100,2,2
100,2,2 100,1,1 100,1,1 100,2,2 100,1,1 100,1,1 100,1,1 100,1,1 100,2,2 100,4,4 100,2,2 100,2,2 100,2,2 100,3,3 100,5,5 83,6,5 100,2,2 100,1,1 100,1,1 100,1,1
100,3,3 100,3,3 100,1,1 100,4,4