Workaround discount's eliding of <style> blocks.
authorJoey Hess <joey@kitenet.net>
Sun, 15 Jan 2012 20:19:22 +0000 (16:19 -0400)
committerJoey Hess <joey@kitenet.net>
Sun, 15 Jan 2012 20:19:22 +0000 (16:19 -0400)
IkiWiki/Plugin/mdwn.pm
debian/changelog

index b10d085174c5d808c322f8c78bc48c8ecaa6bc39..338468e23b8bb7d0353424c2b849b153b1d75ee4 100644 (file)
@@ -54,10 +54,17 @@ sub htmlize (@) {
                        eval q{use Text::Markdown::Discount};
                        if (! $@) {
                                $markdown_sub=sub {
+                                       my $t=shift;
                                        # Workaround for discount binding bug
                                        # https://rt.cpan.org/Ticket/Display.html?id=73657
-                                       return "" if $_[0]=~/^\s*$/;
-                                       Text::Markdown::Discount::markdown(@_);
+                                       return "" if $t=~/^\s*$/;
+                                       # Workaround for discount's eliding
+                                       # of <style> blocks.
+                                       # https://rt.cpan.org/Ticket/Display.html?id=74016
+                                       $t=~s/<style/<elyts/ig;
+                                       my $r=Text::Markdown::Discount::markdown($t);
+                                       $r=~s/<elyts/<style/ig;
+                                       return $r;
                                }
                        }
                }
index 142ca24ea95965672c92eb2b77cb873947f3e6ac..e60f87f29e4c8f0beadddbac824046a328d3375a 100644 (file)
@@ -1,6 +1,7 @@
-ikiwiki (3.20120110) UNRELEASED; urgency=low
+ikiwiki (3.20120115) UNRELEASED; urgency=low
 
   * Make backlink(.) work. Thanks, Giuseppe Bilotta.
+  * Workaround discount's eliding of <style> blocks.
 
  -- Joey Hess <joeyh@debian.org>  Fri, 13 Jan 2012 13:43:14 -0400