Last active
September 6, 2019 08:21
-
-
Save kagg-design/0edcf726c4f8a59e77a491252bb8be01 to your computer and use it in GitHub Desktop.
Due to issue in SyntaxHighlighter Evolved plugin & symbol is output as & what makes code unreadable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Filter to fix issue in SyntaxHighlighter Evolved plugin. | |
* | |
* @param string $code Code to format. | |
* @param array $atts Attributes. | |
* @param string $tag Tag. | |
* | |
* @return string | |
*/ | |
function kagg_syntaxhighlighter_precode( $code, $atts, $tag ) { | |
if ( 'code' === $tag ) { | |
$code = wp_specialchars_decode( $code ); | |
} | |
return $code; | |
} | |
add_filter( 'syntaxhighlighter_precode', 'kagg_syntaxhighlighter_precode', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice little code snippet, but how do you make SyntaxHighlighter Evolved use it?