diff --git a/syntaxhighlighter.php b/syntaxhighlighter.php index 667a2b7..d0db9cb 100644 --- a/syntaxhighlighter.php +++ b/syntaxhighlighter.php @@ -500,6 +500,7 @@ public function enable_brushes_via_raw_html_parsing( $content ) { */ public function render_block( $attributes, $content ) { $remaps = array( + 'className' => 'classname', 'lineNumbers' => 'gutter', 'firstLineNumber' => 'firstline', 'highlightLines' => 'highlight', @@ -1243,7 +1244,7 @@ function shortcode_callback( $atts, $code = '', $tag = false ) { // Sanitize the "classname" parameter if ( 'class-name' == $key ) - $value = trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) ); + $value = "'" . trim( preg_replace( '/[^a-zA-Z0-9 _-]/i', '', $value ) ) . "'"; // Special sanitization for "pad-line-numbers" if ( 'pad-line-numbers' == $key ) {