Permalink
Browse files

easier syntax for brushes

  • Loading branch information...
1 parent 84feb2f commit 92b95f46f81000390262248caa8e9362629222bc @yanick committed Mar 28, 2011
Showing with 5 additions and 0 deletions.
  1. +3 −0 lib/Galuga/Controller/Entry.pm
  2. +2 −0 lib/Galuga/Controller/Root.pm
@@ -60,6 +60,9 @@ sub index :Chained('base') :PathPart('') :Args(0) :Sitemap(*) {
$body =~ s#(<galuga_code.*?</galuga_code>)#code_snippet( $c, $rs, $1 )#eg;
+ $body =~ s[<pre>\s*<code>\s*#syntax:\s*(\S+)\n(.*?)</code>\s*</pre>]
+ [<pre class="brush: $1">$2</pre>]gs;
+
my @syntax;
while ( $body =~ s#<pre \s+ code=(['"])(.*?)\1#<pre class="brush: $2" #xg ) {
push @syntax, $2;
@@ -100,6 +100,8 @@ sub feed :Path('atom.xml') :Args(0) :Sitemap {
s#(<galuga_code.*?</galuga_code>)#Galuga::Controller::Entry::code_snippet( $c, $_, $1 )#eg;
$body =~ s#<pre \s+ code=(['"])(.*?)\1#<pre class="brush: $2" #xg;
+ $body =~ s[<pre>\s*<code>\s*#syntax:\s*(\S+)\n(.*?)</code>\s*</pre>]
+ [<pre class="brush: $1">$2</pre>]gs;
$body =~ s#<cpan>(.*?)</cpan>#Galuga::Controller::Entry::cpan_tag($1)#eg;
$body =~ s#<galuga_entry>(.*?)</galuga_entry>#Galuga::Controller::Entry::entry_tag( $c, $1)#eg;

0 comments on commit 92b95f4

Please sign in to comment.