diff --git a/code.php b/code.php index f699bb4..dfd66fd 100644 --- a/code.php +++ b/code.php @@ -62,10 +62,13 @@ public function feed_content($post) { return $post->code; } - public function format_code($text, $post = null) { - if (isset($post)) { - $post->code_unformatted = $post->code; + public function format_code($text, $post = null) { + if(isset($post)) { $code = $text; + if(preg_match("/\[gist: ([0-9]+)\]/i", $code, $matches)) { + return ''; + } + $post->code_unformatted = $post->code; $languages = getLanguages(); $geshi = new GeSHi($code, $languages[$post->language]); diff --git a/info.yaml b/info.yaml index 36aa8e1..aca7bfb 100644 --- a/info.yaml +++ b/info.yaml @@ -1,6 +1,6 @@ name: Code url: http://guitsaru.com/ -version: 1 +version: 1.1 description: Post code snippets with geshi syntax highlighting. author: name: Matt Pruitt diff --git a/readme.txt b/readme.txt index 91b7213..9ee6f65 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,6 @@ Install: Copy the code folder into your feathers directory Copy code.twig into your themes feathers directory -Add the contents of style.css to your themes stylesheets/screen.css file \ No newline at end of file +Add the contents of style.css to your themes stylesheets/screen.css file + +You can now embed gists using [gist: 2729], replacing 2729 with your gists id. \ No newline at end of file diff --git a/style.css b/style.css index e837a9a..a1ccda9 100644 --- a/style.css +++ b/style.css @@ -1,7 +1,7 @@ pre#geshi_code { - padding: 7px 2px; - overflow: auto; - line-height: 11pt; + padding: 7px 2px; + overflow: auto; + line-height: 11pt; border-style: dotted; border-width: 1px; max-height: 300px;