Skip to content

Instantly share code, notes, and snippets.

@ootput
Created June 25, 2010 13:37
Show Gist options
  • Select an option

  • Save ootput/452850 to your computer and use it in GitHub Desktop.

Select an option

Save ootput/452850 to your computer and use it in GitHub Desktop.
Index: code_escape.plugin.php
===================================================================
--- code_escape.plugin.php (revision 3226)
+++ code_escape.plugin.php (working copy)
@@ -4,7 +4,7 @@
public function filter_post_content_out ( $content, $post ) {
- $content = preg_replace_callback('/<code>(.*?)<\/code>/s', array( 'self', 'escape_code' ), $content);
+ $content = preg_replace_callback('/<code class="prettyprint">(.*?)<\/code>/s', array( 'self', 'escape_code' ), $content);
return $content;
@@ -16,7 +16,7 @@
$string = htmlspecialchars( $string );
- $string = '<code>' . $string . '</code>';
+ $string = '<code class="prettyprint">' . $string . '</code>';
return $string;
@@ -30,4 +30,4 @@
}
-?>
\ No newline at end of file
+?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment