SyntaxHighlighter Evolved

Description:

As seen on WordPress.com.

SyntaxHighlighter Evolved allows you to easily post syntax-highlighted code to your site without having to escape the code or anything. It uses the SyntaxHighlighter JavaScript package by Alex Gorbatchev to do the highlighting and supports all of the package’s parameters via shortcode attributes.

For a list of supported languages (most widely used languages are supported), see the WordPress.com support document.

Example Code Output:

Note that there are various different color schemes available.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<title>PHP Code Example</title>
</head>
<body>
	<h1>PHP Code Example</h1>

	<p><?php echo 'Hello World!'; ?></p>

	<p>This line is highlighted.</p>

	<div class="foobar">
		This	is	an
		example	of	smart
		tabs.
	</div>

	<p><a href="http://wordpress.org/">WordPress</a></p>
</body>
</html>

If you prefer, you can hide the line numbering and other UI stuff with the “light” mode, for example:

[php light="true"]your code here[/php]

There are many other parameters and defaults you can control via the Settings page or the shortcode parameters. Full details and instructions are located at the bottom of the Settings page.

Download:

GitHub:

This plugin is available on GitHub. Issues, patches, and pull requests are welcome.

https://github.com/Viper007Bond/syntaxhighlighter

1,605 thoughts on “SyntaxHighlighter Evolved

  1. Pingback: ???????? Linux????? (4) ????????=>WordPress??? | ???????????????

  2. Pingback: What are WordPress Shortcodes? - Gretchen Louise

  3. Hello again,

    I am using bbPress 2.0 and looking into your source code, I found adding support for bbPress 2.0 is really as simple as adding the following line to the __construct of SyntaxHighlighter class

    add_filter( 'bbp_get_reply_content',      array( $this, 'parse_shortcodes' ),                                      7 ); // BuddyPress

    Can you please add it officially?

  4. Pingback: SyntaxHighlighter Evolved | Tidy Repo

  5. Pingback: My first attempt at a WordPress child theme | Technology is cool WHEN it works

  6. I’ve just installed this plugin and it works fine for me. After testing other syntax highlighter plugins at last I found one which is easy to use and works fine. Thanks Viper for this very useful plugin.

  7. Pingback: Wordpress Customization | The Devil In The Details

  8. Pingback: WordPress blog için gerekli 10 eklenti | Sekizncihayat Blog | Webmaster Blogu | HTML5, CSS3, Jquery, PHP, MYSQL

  9. It seams so that your plugin will correct the inserted code. I entered the line
    echo -e "This is a Test" on html editor and I get published
    echo -e \"This is a Test\". So the quote signs will be escaped.
    How could I disable these feature?

  10. Pingback: Source code syntax highlighter plugin for WordPress | p'code

  11. SyntaxHighlighter Evolved shortcodes (ie. “java”, etc.) don’t work with my Sympathique WordPress theme (http://themeforest.net/item/sympathique-responsive-wordpress-theme/5714733). For some strange reason, all shortcode content is replaced by “1”…

    After playing a bit with the code, I ended up with the following workaround:

    // syntaxhighlighter.php __construct:

    foreach ( $this->shortcodes as $shortcode ) {
    // add_shortcode( $shortcode, array(this, ‘__return_true’) ); –> this is the cause of the problem.
    add_shortcode( $shortcode, array(this, ‘do_nothing’) );
    }

    function do_nothing($atts, $content = null) {}

    It seems that the __return_true function is actually called, hence the “1” (true as an int)…

    I have no idea what exactly is the cause of the problem, but it has something to do my theme and other people seem to have the same issue with other themes as well (eg. http://themeforest.net/item/sympathique-responsive-wordpress-theme/5714733).

    Best.

  12. Pingback: Google Prettify + WordPress | robinadr

  13. Pingback: WordPress??????SyntaxHighlighter?????? | WordPress Tips

  14. @Alex: I did a german translation of this plugin. You might want to include this in your next release. Is there a way to email this to you?

  15. Pingback: phpr.org WordPress temas?! | Emincan ?pekçi

  16. Pingback: ???? | ????

  17. Pingback: Bulldog cafe?????????? | BULLDOG CAFE

  18. Pingback: wordpress ?????? | ???????

  19. Pingback: Programming: Quellcodevisualisierung | SvenFrank Media

  20. Pingback: Wordpress Plugin für LaTeX Satz und für Code-Listings | holmez blog

  21. Pingback: ?worldpress????????? | Jky??????

  22. Pingback: use code tag for better readability | Online toolbag blogs -www.OnlineToolbag.com

  23. Pingback: ??????????wordpress??????? | hvvorks

  24. Pingback: WordPress???????????????????????”SyntaxHighlighter Evolved” | WordPress??

  25. Pingback: WordPress???????????????????????”SyntaxHighlighter Evolved” | WordPress??

  26. Pingback: ??????????????????????????????????SyntaxHighlighter Evolved? | ????????

  27. Pingback: SyntaxHighlighter Evolved | 3kmh

  28. Pingback: WordPress??????????????????????? “SyntaxHighlighter Evolved” | WordPress??

  29. Pingback: WordPress??????????????????????? “SyntaxHighlighter Evolved” | WordPress??

  30. Pingback: How to use org2blog effectively as a programmer | ?????

  31. Pingback: The dangers of editing a published post | Kurt's Comments

  32. Pingback: phpr.org wordpress temas?! | Emincan ?pekçi

  33. Do you have any plans to make v 3 support line wrapping? This is by far the best code formatter out there, but i can’t deal with the horizontal scrollbar. I need to run v 2 because of it.

  34. i have a Ask, on the Site stand, for the Problem with BR Tags i can edit the config, but there is nothing a config file. :/ In each line is e br tag, thats very bad.

    And i love this Plugin. :)

  35. Pingback: WordPress code tags. | Notes and Observations

  36. Pingback: Highlighting Source Code Syntax in WordPress using SyntaxHighlighter | TechTut.Net

  37. Pingback: El Top 100 de los Plugins de WordPress para su Sitio | Eduarea's Blog

  38. Pingback: Code in WordPress (SyntaxHighlighter Evolved) | Daniels Blog

  39. Pingback: Show jQuery Source Code In Your WordPress Blog | jQuery4U | No.1 Resource for jQuery Developers

  40. Pingback: Làm ??p code trong blog v?i SyntaxHighlighter | Backtrack - Pentesting - MMO - CEH - SEO

  41. Pingback: Using Custom Theme with SyntaxHighlighter Evolved | Biboroku

  42. I’ve just updated WordPress and this pug-in after having them installed for a very long time without updates. Now all quotes and amps are getting converted to ampersand character codes but doubled. so in my code on the page there are tons of quote, amp, gt and lt codes showing. I feel like I fixed this before by editing something in the plug-in or maybe in a WordPress file. can you please point me in the right direction. Thanks.

  43. Pingback: Cómo añadir código embebido dentro de nuestros post en WordPress | INFOTIPS

  44. I am using WP 3.9 + Jetpack Markdown (2.9.3) + your Syntax Highlighting Evolved. Mostly great, but:

    If my listings contain ‘greater’ or ‘lesser’ or ‘ampersand’ or ‘double quotation mark’, Markdown recodes them to HTML entities like _gt_, _ls_ etc. Without your plugin, code is still shown correct. But with your plugin, the listings contain _gt_ etc. instead of ‘greater’.

    Don’t know who is to blame. Any ideas how to resolve this? Thank you!

  45. Pingback: Wordpress Plugins I can't live without - By Mike Hudson

  46. Pingback: WordPress??????SyntaxHighlighter?????? | ????

  47. Hi Alex,
    thanks a lot for creating the plugin! I was just wondering, is there any way I can add a custom css template? If yes, how can I do it?

  48. Alex,

    If we are also using the Speed Booster Pack plugin, setting Defer parsing of javascript files seems to break your plugin. I tried other plugins that ‘Defer parsing of javascript files’ and the same issue occurred.

    I would love an update that worked with ‘Defer parsing of javascript files’ enabled.

    Looks like when the javascript goes to run, I get this error in chrome:

    Uncaught ReferenceError: SyntaxHighlighter is not defined

    Later,

    Jared

  49. HI THERE! I’m using your plug in and it seems to work fine except after i update the page a coupe of times (without editing anthing in the edit page, it starts changing characters. for example: ” for &quot. do you know how can i prevent this? i’m using csharp

    thanks!

  50. Pingback: WordPress Plugintipp – SyntaxHighlighter Evolved | just4testing.com

  51. Pingback: The Top 100 WordPress Plugins For Your Site | HumanART

  52. Pingback: Ciseco - Posting code with brushes

  53. Pingback: ????????? | bassen_blog

  54. I’d love to see this plugin work if using the “Delay JavaScript” feature of the “Speed Booster Pack” plugin. Currently, I have Speed Booster Pack enabled, but I had to disable the “Delay JavaScript” feature.

  55. Pingback: ?? Markdown ?? WordPress ?? | ????

  56. Pingback: WordPress ? GitHub Gist ? Swift | MUSHIKAGO APPS MEMO

  57. Pingback: [M] 2012??! ???????????WordPress?????52? | mbdb (????)

  58. Pingback: ?? Markdown ?? WordPress ?? | ????

  59. Pingback: Wordpress Temas? | Demirpençe

Leave a Reply