=== SyntaxHighlighter Evolved === Contributors: Viper007Bond, Automattic Donate link: http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/donate/ Tags: code, sourcecode, php, xhtml, html, css Requires at least: 2.7 Tested up to: 2.8 Stable tag: trunk Easily post syntax-highlighted code to your site without having to modify the code at all. As seen on WordPress.com. == Description == SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without loosing it's formatting or making any manual changes. It uses the [SyntaxHighlighter JavaScript package by Alex Gorbatchev](http://alexgorbatchev.com/wiki/SyntaxHighlighter). For a live demo, see [this plugin's homepage](http://www.viper007bond.com/wordpress-plugins/syntaxhighlighter/). For a list of supported languages (most widely used languages are supported), see the [WordPress.com support document](http://en.support.wordpress.com/code/posting-source-code/). *As seen on WordPress.com.* == Installation == ###Upgrading From A Previous Version### To upgrade from a previous version of this plugin, delete the entire folder and files from the previous version of the plugin and then follow the installation instructions below. ###Uploading The Plugin### Extract all files from the ZIP file, **making sure to keep the file/folder structure intact**, and then upload it to `/wp-content/plugins/`. **See Also:** ["Installing Plugins" article on the WP Codex](http://codex.wordpress.org/Managing_Plugins#Installing_Plugins) ###Plugin Activation### Go to the admin area of your WordPress install and click on the "Plugins" menu. Click on "Activate" for the "SyntaxHighlighter" plugin. ###Plugin Usage### Just wrap your code in `[language]`, such as `[php]code here[/php]` or `[css]code here[/css]`. For a list of supported languages (all widely used languages are supported), please [click here](http://alexgorbatchev.com/wiki/SyntaxHighlighter:Brushes). You do not need to escape HTML entities or anything, just post your code as-is. The plugin will handle the rest. The shortcodes accept a wide variety of parameters. For details, see the bottom of the plugin's settings page. == Frequently Asked Questions == = The code boxes seem to be missing their styling. What's wrong? = Make sure your theme's `header.php` file has `` somewhere inside of the `
`, otherwise the CSS files won't be loaded. = The code is just being displayed raw. It isn't being converted into a code box or anything. What's wrong? = Make sure your theme's `footer.php` file has `` somewhere inside of it, otherwise the Javascript files won't be loaded. == Screenshots == 1. Example code display of some PHP inside some HTML. 2. A part of the Settings page which controls the defaults. == ChangeLog == **Version 2.3.2** * Allow `\0` inside of code posts for low-access users. Previously it was stripped by KSES. Also introduces new filter that can be used to escape other similar types of strings. * Remove `min-height` CSS. I don't see the point of it and it's screwing it up in certain themes. **Version 2.3.1** * Additional CSS to help prevent themes from breaking SyntaxHighlighter (stopping `code { display: block; }`). * Add a grey border to the default theme when line numbering is enabled. * Italian transation update thanks to [gidibao](http://gidibao.net/). * Minor code improvements. **Version 2.3.0** Major overhaul, mainly to extend flexibility so that this plugin could be used on WordPress.com without any more plugin code modification (only actions/filters are used instead to modify it). * Updated SyntaxHighlighter package to v2.1.364. Highlights of the [changelog](http://alexgorbatchev.com/wiki/SyntaxHighlighter:Changes:2.1.364) include: * ColdFusion brush (aliases: `coldfusion`, `cf`) * Erlang brush (aliases: `erl`, `erlang`) * Objective-C brush (aliases: `objc`, `obj-c`) * Eclipse theme * `padlinenumbers` parameter. Set it to `false` for no line number padding, `true` for automatic padding, or an integer (number) for forced padding. * `rb` alias for Ruby * Commenters can now use this plugin to post code. * Plugin's shortcodes now work inside of the text widget again. Requires WordPress 2.9+ though. * Overhaul of the TinyMCE plugin that assists in keeping your code sound when switching editor views. Thanks to Andrew Ozz! * This plugin's stylesheets are now dynamically loaded. If they aren't needed, they aren't loaded. * Lots of sanitization of shortcode attributes. Invalid keys/values are no longer used. * New filter to control what shortcodes are registered. Used by WordPress.com to trim down the number of them. * Saving of user's settings is now done using `register_setting()` instead of manually handing `$_POST`. Yay! * By default, a post meta is used to mark posts as being encoded using the 2.x encoding format. This is bad for a site like WordPress.com. You can use the new `syntaxhighlighter_pre_getcodeformat` filter to return `1` or `2` (based on say `post_modified`). See `SyntaxHighlighter:get_code_format()` for more details. Don't forget to `remove_action( 'save_post', array(&$SyntaxHighlighter, 'mark_as_encoded'), 10, 2 );` to stop the post meta from being added. * New `syntaxhighlighter_precode` filter to modify raw code before it's highlighted. * New `syntaxhighlighter_democode` filter to modify example code on the settings page. Localizations: * Danish translation update thanks to [Georg S. Adamsen](http://wordpress.blogos.dk/). * Chinese translation thanks to Hinker Liu. Will need updating for v2.3.0. **Version 2.2.1** * Italian transation thanks to [gidibao](http://gidibao.net/index.php/2009/07/22/syntaxhighlighter-evolved-in-italiano/). **Version 2.2.0** * Stop whitespace from being stripped when switching editor views. Props [Abel Braaksma](http://www.undermyhat.org/blog/2009/07/fix-for-leading-whitespace-bug-in-syntaxhighlighter-evolved-for-wordpress/). * Fixed an issue with SyntaxHighlighter itself in which the Bash highlighter had issues with `<` and `>`. * Force a specific font size for the code so themes don't mess with it. * Allow the usage of custom aliases that aren't allowed by the highlighting package. Props [Anton Shevchuk](http://anton.shevchuk.name/). * Danish translation thanks to [Georg S. Adamsen](http://wordpress.blogos.dk/2009/05/07/syntaks-farvning-%E2%80%93-syntax-highlighting/). * Turkish translation thanks to [Alper](http://turkcekaynak.net/). **Version 2.1.0** * Updated to reflect the new features of [v2.0.320 of Alex's script](http://alexgorbatchev.com/wiki/SyntaxHighlighter:Changes:2.0.320). Note the `stripBrs` parameter is not supported in my plugin as it is not needed in this implementation. **Version 2.0.1** * Andrew Ozz was kind enough to fix a bug related to ``'s being stripped when switching from the Visual to HTML tab * Added a link to the settings page to the plugins page in the admin area **Version 2.0.0** * Complete recode from scratch. Features v2 of Alex Gorbatchev's script, usage of shortcodes, and so much more. **Version 1.1.1** * Encode single quotes so `wptexturize()` doesn't transform them into fancy quotes and screw up code. **Version 1.1.0** * mdawaffe [fixed](http://dev.wp-plugins.org/ticket/703) an encoding issue relating to kses and users without the `unfiltered_html` capability. Mad props to mdawaffe. **Version 1.0.1** * Minor CSS fixes. * Filter text widgets to allow posting of code. **Version 1.0.0** * Initial release!