Changeset 600150
- Timestamp:
- 09/17/2012 04:55:27 PM (14 years ago)
- Location:
- wp-markdown-syntaxhighlighter/branches/01-techmanrc
- Files:
-
- 1 added
- 1 deleted
- 1 edited
-
wp-markdown-syntaxhighlighter-diff.php (added)
-
wp-markdown-syntaxhighlighter.diff (deleted)
-
wp-markdown-syntaxhighlighter.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-markdown-syntaxhighlighter/branches/01-techmanrc/wp-markdown-syntaxhighlighter.php
r600137 r600150 45 45 46 46 function wmsh_filter_markdown( $text ) { 47 $return = preg_replace( '|<pre><code>#!!([^\n]+)\n(.*?)</code></pre>|se', 'wmsh_add_parameters(\'$2\',\'$1\');', $text); 48 $return = preg_replace( '|<pre><code>#!([^\n]+)\n(.*?)</code></pre>|se', 'wmsh_add_language(\'$2\',\'$1\');', $return); 49 return $return; 47 $return = preg_replace_callback( 48 '|<pre><code>#!!([^\n]+)\n(.*?)</code></pre>|s', 49 function( $m ) { 50 return wmsh_add_parameters($m[2], $m[1]); 51 }, 52 $text 53 ); 54 55 $return = preg_replace_callback( 56 '|<pre><code>#!([^\n]+)\n(.*?)</code></pre>|s', 57 function( $m ) { 58 return wmsh_add_language($m[2],$m[1]); 59 }, 60 $return 61 ); 62 63 return $return; 50 64 } 51 65 … … 115 129 */ 116 130 function wmsh_add_language( $code, $language ) { 117 if(strcasecmp($language, 'xml') == 0) {118 $code = stripslashes( trim( str_replace(array('&', ''', '"'), array('&','\'','"'), $code) ) );119 } else {120 $code = stripslashes( trim( htmlspecialchars_decode( $code, ENT_NOQUOTES ) ) );121 }122 131 return '<pre class="' . WMSH_BRUSH . ': '. $language . '; notranslate">' . $code . '</pre>'; 123 132 } … … 143 152 $class = parseParameters($params) . "notranslate"; 144 153 145 if(strcasecmp($params[WMSH_BRUSH], 'xml') == 0) {146 $code = stripslashes( trim( str_replace(array('&', ''', '"'), array('&','\'','"'), $code) ) );147 } else {148 $code = stripslashes( trim( htmlspecialchars_decode( $code, ENT_NOQUOTES ) ) );149 }150 154 151 155 $output = "<pre class=\"" . $class . "\"";
Note: See TracChangeset
for help on using the changeset viewer.