From: Simon McVittie Date: Sun, 14 May 2017 16:34:12 +0000 (+0100) Subject: mdwn: Make flags passed to libdiscount explicit X-Git-Tag: debian/3.20170622~49 X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/commitdiff_plain/5d65c1ad2c1d4a39dcb8c36d6ae6e4d458ed829f?ds=sidebyside;hp=60cb2ac458dc8dea3b6a72abe52dcb1cd05617a4 mdwn: Make flags passed to libdiscount explicit The Perl binding defaults to MKD_NOHEADER|MKD_NOPANTS anyway, but making them explicit means we can use other flags of our choice, and makes it easier to justify why those flags are appropriate. --- diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm index daf9d592e..436f2461d 100644 --- a/IkiWiki/Plugin/mdwn.pm +++ b/IkiWiki/Plugin/mdwn.pm @@ -64,14 +64,26 @@ sub htmlize (@) { if (! $@) { $markdown_sub=sub { my $t=shift; + # Workaround for discount binding bug # https://rt.cpan.org/Ticket/Display.html?id=73657 return "" if $t=~/^\s*$/; + + my $flags=0; + + # Disable Pandoc-style % Title, % Author, % Date + # Use the meta plugin instead + $flags |= Text::Markdown::Discount::MKD_NOHEADER(); + + # Disable Unicodification of quote marks, em dashes... + # Use the typography plugin instead + $flags |= Text::Markdown::Discount::MKD_NOPANTS(); + # Workaround for discount's eliding # of