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,565 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

Leave a Reply