]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/mdwn.pm
mdwn: Restore historical behaviour
[git.ikiwiki.info.git] / IkiWiki / Plugin / mdwn.pm
index 9f06c03f2ec05678e0426a723a352eab7475313c..66116ae014f7a94cd8bda230514258bbb75acf42 100644 (file)
@@ -125,6 +125,31 @@ sub htmlize (@) {
                                                $flags |= 0x00400000;
                                        }
 
+                                       # Enable fenced code blocks in libmarkdown >= 2.2.0
+                                       # https://bugs.debian.org/888055
+                                       if (Text::Markdown::Discount->can("MKD_FENCEDCODE")) {
+                                               $flags |= Text::Markdown::Discount::MKD_FENCEDCODE();
+                                       }
+                                       else {
+                                               $flags |= 0x02000000;
+                                       }
+
+                                       # PHP Markdown Extra-style term\n: definition -> <dl>
+                                       if (Text::Markdown::Discount->can("MKD_DLEXTRA")) {
+                                               $flags |= Text::Markdown::Discount::MKD_DLEXTRA();
+                                       }
+                                       else {
+                                               $flags |= 0x01000000;
+                                       }
+
+                                       # Allow dashes and underscores in tag names
+                                       if (Text::Markdown::Discount->can("MKD_GITHUBTAGS")) {
+                                               $flags |= Text::Markdown::Discount::MKD_GITHUBTAGS();
+                                       }
+                                       else {
+                                               $flags |= 0x08000000;
+                                       }
+
                                        return Text::Markdown::Discount::markdown($t, $flags);
                                }
                        }