This plugin is code syntax highlighter based on SyntaxHighlighter ver. 3.0.83 and 2.1.382.
Author: | redcocker (profile at wordpress.org) |
WordPress version required: | 2.8 |
WordPress version tested: | 3.3.2 |
Plugin version: | 1.7.3 |
Added to WordPress repository: | 02-05-2011 |
Last updated: | 29-02-2012
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 100 |
Rated by: | 1 |
Plugin URI: | http://www.near-mint.com/blog/software/wp-syn... |
Total downloads: | 49 017 |
Active installs: | 500+ |
Click to start download
|
This plugin is code syntax highlighter based on Alex Gorbatchev’s SyntaxHighlighter ver. 3.0.83 and 2.1.382.
Features
- Based on Alex Gorbatchev’s “SyntaxHighlighter” JavaScript library.
- Including both SyntaxHighlighter 3.0.83 and 2.1.382.(Can switch between 3.0.83 and 2.1.382.)
- Built-in TinyMCE buttons and Quicktag button are easy to operate.
- Easy to wrap your code in
<pre>
tag and change options of previously-wrapped code.
- Support shortcode also.
- Easy to highlight code in comments using buttons.(WordPress 3.0 or higher)
- Widget to show highlighted code.
- Support bbPress plugin 2.0 or higher.
- Support “Dynamic Brush Loading” which allows to load only necessary brush files dynamically.
- Loading JavaScripts on only posts, pages, home, archives, search results and comments which have the code to highlight.
- Easy to configure features through the setting panel.
- Localization: English(Default), 日本語(Japanese, UTF-8).
Supported languages
AppleScript, ActionScript3, Bash, ColdFusion, C, C++, C#, CSS, Delphi, Diff, Erlang, Groovy, HTML, Java, Java FX, JavaScript, Pascal, Patch, Perl, PHP, Plain text, PowerShell, Python, Ruby, Ruby on Rails, Sass, SCSS, Shell, SQL, VB, VB NET, XHTML, XML and XSLT
Note: A part of languages are only for SyntaxHighlighter 3.0.
You can also use a bundled plugin to add following languages.
Biferno, Clojure, DOS batch file, F#, LISP, Lua(only for SyntaxHighlighter 3.0), MEL Script, Objective-C, PowerCLI, Processing, R, S, S-PLUS, Tcl, Verilog, Vim Script and YAML
For details, see “sample” directory.
There are many other languages for “SyntaxHighlighter”. But I can’t bundle them because they are not compatible with this plugin license. If you want, try to search.
Recommended plugin
Thanks
Screenshots
This is a highlighted code.
This is a highlighted code in comments and buttons added to the form.
This is a highlighted code in bbPress and buttons added to the form
This is setting panel.
This is "SH TinyMCE" button.
This is pop up window at the click of "pre" button.
This is pop up window at the click of "CODE" button.
This is "SH pre" button.
This is pop up window at the click of "SH pre" button.
FAQ
Q. The highlighted code can not be displayed. The code is displayed as just raw.
A. This plugin requires placing <?php wp_head(); ?>
and <?php wp_footer(); ?>
in your theme files. You must place <?php wp_head(); ?>
before the closing head tag in header.php and place <?php wp_footer(); ?>
before the closing body tag in footer.php.
Q. Buttons are missing on my Visual editor.
A. This pluguin requires TinyMCE(default Visual editor). If you replaced default Visual editor with other(e.g. CKEditor etc.), Buttons can’t be shown on your Visual editor.
Q. I want to change language and options of previously-markuped code with “pre” button. But I can’t select whole my code.
A. You need not to select whole your code. It’s enough to select first line of your code.
Q. After the update to new version, Buttons do not work correctly.
A. Old javascript files may be cached. Please clear your browser’s cache or delete cached javascript files.
Q. How to stop translating my code with “Google Translate”.
A. Go to setting panel and enter “notranslate” into “Class name”. When another class has already been defined, add “notranslate” separated by space.
Q. I get a message saying “invalid” in a textarea on setting panel.
A. The value of textarea contains some character strings that are not allowed to use. Re-enter valid value and save it. It may occur after you upgraded to 1.5.6 or higher.
Q. “SH pre” button(Quicktag) or other buttons in the editor doesn’t pop up a dialog box.
A. Go to setting panel and try to enable/disable “Load jQuery and jQuery UI” option in “HTML Editor Settings”(or “Comment Editor Settings”) section.
ChangeLog
1.7.3
- Modified wp_sh_escape_code(), wp_sh_wp_filter_kses(), wp_sh_replace_marker(), wp_sh_add_extra_bracket() filters with preg_replace_callback().
- Added wp_sh_make_clickable() filter to apply make_clickable() to the content when the content includes no sourcecode.
- Fix a bug: Wrong regular expression in wp_sh_escape_code().
- Fix a bug: wp_sh_escape_code() can’t handle sourcecode including [sourcecode], [source] or [code].
- Fix a bug: WP SyntaxHighlighter version doesn’t be shown in “12. Your System Info” setting section.
1.7.2
- Added wp_sh_strip_shortcodes() and wp_sh_strip_shortcode_tag() for stripping shortcode tag.
1.7.1
- Fix a bug: Filters can’t handle sourcecodes including $n(n = numbers) correctly.
1.7
- Support bbPress plugin.
- Support shortcode.
- Added another button which makes easy to insert “shortcode” for the comment form.
- Added another button which makes easy to insert “shortcode” for “WP SyntaxHighlighter Widget”.
- Users without “unfiltered_html” also can edit a post with codes.
- Comments before approved can be highlighted.
- Added new filters for posts.
- Replaced filters for comment with new ones.
- A part of defaut setting values changed.
- Bundled sample plugin can add new language(Biferno).
- Splited the main php file in order to reduce file size.
- Fix a bug: Added filters for comment form can’t handle sourcecodes including
&#xxx;
correctly.
- Fix a bug: Using bloginfo() in the wrong way.
- Fix a bug: Some missing textdomains.
- Fix a bug: The mix LF and CR/LF in a part of SyntaxHighligter core files.
1.6.7
- Modified Quicktag processing to be compliant with WordPress 3.3.
- Added “Quick code copy” option into the setting panel.
- Fix a bug: Wrong textdomain fot localization.
- Fix a bug: Wrong replacing
</pre>
tag in the code when comment updated.
1.6.5
- Added “SH pre” button into the Comment editor.
- Added “Load jQuery and jQuery UI” option into the setting panel.
- Enabled to escape souececodes to HTML entities automatically when updating a commnet.
- Fix a bug: Loaded jQuery UI component affects other ajax buttons.
- Fix a bug: When using WordPress 3.0.6 or older, “SH pre” button doesn’t work.
- Fix a bug: When using WordPress 2.9.2 or older, after saving changes, some setting values get empty. Some problems might come to the surface after upgrading to WordPress 3.0 or higher.
- Fix a bug: TinyMCE “code” button can’t handle sourcecodes including HTML entities(
&
, <
, >
, "
, '
😉 correctly.
- Fix a bug: Added filters for comment form can’t handle sourcecodes including HTML entities(
&
, <
, >
, "
, '
😉 correctly.
- Fix a bug: “WP SyntaxHighlighter Widget” can’t handle sourcecodes including HTML entities(
&
, <
, >
, "
, '
😉 correctly.
- Fix a bug: A typo in setting values.
1.6
- Added “SH pre” button to HTML editor. It make easy to wrap your code in
<pre>
tag.
1.5.8
- Rewritten the codes for array definition.
- Fix a bug: When using code button, some browsers give extra line break.
1.5.7
- Validating the setting values more closely.
- Added the icon before title block on the setting panel.
- Fix a bug: The setting data migration processing can’t work concurrently with auto-update.
- Fix a bug: A error message don’t be translated.
1.5.5
- Added new setting option to change text label for collapsed code block.
- Most of setting parameters are stored as associative arrays in SQL.
- Redesigned setting panel.
- Changed the method of displaying the notice message for admin.
- Only when “comments_open()” is true, “Comment Highlight Button” processing is run.
- After “Comment Highlight Button” is enabled, force on “comments” option.
- Moved javascript files to “js” directory.(except TinyMCE plugin and SyntaxHighlighter library)
- Moved css files to “js” css.(except SyntaxHighlighter library)
- Bundled sample plugin support i18n and new method of displaying the notice for admin.
- Changed line feed codes to LF.(except SyntaxHighlighter library, added brush and text files) The line feed codes were CR/LF in the many of files.
- Checking if the current request carries a valid nonce when settings are saved or reset.
- Changed default text which is show before comment form. Thanks Judah.
- Changed the processing when plugin is updated.
- Fix a bug: Unnecessary
<form>
tags in source code of setting panel.
- Fix a bug: Incorrect target versions of brush files are shown in the setting panel.
1.5
- Added the widget to show highlighted code.
- Added “Comment Highlight button” to post a comment with their sourcecodes and highlight them easily.
- Bundled sample plugin can add new languages(DOS batch file, Objective-C). Thanks Andreas Breitschopp who created “shBrushDosBatch-V2.js” and “shBrushDosBatch-V3.js” for WP SyntaxHighlighter.
- Allowed to enter single quotes into “Title”.
- Changed the way to show target versions of brush files in the setting panel.
- Changed the way to show notice for admin.
- Using dirname() and plugin_basename() instead of hardcoded directory name.
- Changed directory name stored translation files.
1.4.4
- Added new theme “None” that allows to apply no stylesheet.
- TinyMCE buttons supported new fullscreen mode in WordPress 3.2 or higher.
- Fix a bug: “Insert” function of “pre” button does not work in the fullscreen mode.
- Fix “Notice: Undefined variable: page_highlight” and “Notice: Undefined variable: comment_highlight”.
- Bundled sample plugin can add new languages(Clojure, LISP, MEL Script, PowerCLI, Vim Script).
1.4.3.1
- Fix a bug: The misdescribed
<script>
tag.
- Modified Japanese translation.
1.4.3
- Added new theme “Random” to apply different theme on each page.
- Added break statements to foreach loops for performance improvement.
- Changed the conditional branching for performance improvement.
- Changed “the_content” hook priority to prevent conflict.
- Added “others” checkbox into “Higlight your code in” option to allow highlighting in particular pages.
- Added new hook to add css files for external plugin.
- Added new method to add brush files for external plugin.
- Bundled new sample plugin.
1.4
- “Autoloading JavaScripts” function will be applicable to not only posts and pages but also home, archives, search results and comments.
- This plugin allows visitors to post comments with their code.
- Changed the conditional branching for adding stylesheet.
- Fix a bug: The addtional stylesheet isn’t added in Categories, Archives and Search result.
- Fix a bug: A message can’t be translate into Japanese.
1.3.9
- Added “Higlight your code in” option that allows you highlight your code in Categories, Archives and Search result.
- Added “Title” and “Line Number Padding” options.
- Users allows “Default languages settings” to be reflected in buttons and “autoloader”.
- Changed processing code for creating buttons.
- Changed the method to add javascripts and css into setting panel.
- Fix a bug: The misdescribed argument of wp_enqueue_style() function.
- Fix a bug: WP SyntaxHighlighter don’t work with WP to Twitter etc.
1.3.8.2
- Fix a bug: The misdescribed
<script>
tag caused HTML validation errors.
1.3.8.1
- The value of $wp_sh_ver was updated.
1.3.8
- Fix a bug: When selectd ver.2.1.382, “copy to clipboard” icon is disappeared from tool bar.
1.3.7
- Added the option to choose pop-up windows size.
- Changed the method to get plugin directory url.
1.3.6
- Fix “Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead.” when “WP_DEBUG” is turned on.
- Changed processing javascripts for admin panel.
1.3.5
- Can define your own stylesheet for the code block.
- Can choose TinyMCE toolbar row which buttons will be placed in.
- Add legacy
<pre>
and <textarea>
tags and attribtes to TinyMCE extended_valid_elements.
- Added “System Info” in setting panel.
- Changed processing code for creating buttons.
1.3
- In ver. 2.0 or “Legacy mode”, loaded languages become pre-selectable through setting panel.
- “Reset All Setting” button Added to setting panel.
<script>
and <textarea>
tag methods are supported.
- Fix a bug: In “Legacy mode”, the source code with old style tag can’t be highlighted correctly.
1.2.3
- Added more language for ver. 2.1.382 by defaut, or this version will load all bundled languages for ver. 2.1.382 by defaut.(added languages are: Actionscript3, Bash shell, ColdFusion, Diff, Erlang, Groovy, JavaFX, Perl, Plain Text, PowerShell,Scala)
- Added “Action hooks” and associative array for developers.
- Comments before approved can be highlighted.
- Fix a bug: When chosen “MDUltra” theme in ver. 2.1, “Your Current Theme” in setting panel can’t be updated correctly.
1.2.2
- To prevent conflict with other TinyMCE button, the priority of a function hooked has been changed.
- Removed an unnecessary file from the file set.
1.2.1
- Fix a bug: “CODE” button does not work in fullscreen mode.
1.2
- Added “CODE” button which allows to paste sourcecode into post or page, keeping indent by tab.
- Enable to change language and options of previously-markuped code.
- Button icons has been changed.
- layout of buttons on TinyMCE popup window has been changed.
1.1.1
- Fix a bug: Sometimes Code do not be highlighted in home.
1.1
- Adding the button to type
<pre>
tag in Visual editor.
- You can preview your current theme in setting panel.
- Fix a bug: Setting values in databese can’t be removed when uninstall.
1.0.1
- Fix a warning in setting panel.
1.0
- This is the initial release.