aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2017-05-14 17:45:55 +0100
committerSimon McVittie <smcv@debian.org>2017-05-14 17:45:55 +0100
commit81c3258269fa53684043ce5b9fd701bb6a381017 (patch)
tree41caeb452a1881245fc523845d7b733bc79fd396 /IkiWiki/Plugin
parent5d65c1ad2c1d4a39dcb8c36d6ae6e4d458ed829f (diff)
downloadikiwiki-81c3258269fa53684043ce5b9fd701bb6a381017.tar
ikiwiki-81c3258269fa53684043ce5b9fd701bb6a381017.tar.gz
mdwn: Don't mangle <style> into <elyts> under some circumstances
We can ask libdiscount not to elide <style> blocks, which means we don't have to work around them.
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/mdwn.pm13
1 files changed, 9 insertions, 4 deletions
diff --git a/IkiWiki/Plugin/mdwn.pm b/IkiWiki/Plugin/mdwn.pm
index 436f2461d..aeb3a3fd7 100644
--- a/IkiWiki/Plugin/mdwn.pm
+++ b/IkiWiki/Plugin/mdwn.pm
@@ -82,10 +82,15 @@ sub htmlize (@) {
# 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, $flags);
- $r=~s/<elyts/<style/ig;
- return $r;
+ if (Text::Markdown::Discount->can("MKD_NOSTYLE")) {
+ $flags |= Text::Markdown::Discount::MKD_NOSTYLE();
+ }
+ else {
+ # This is correct for the libmarkdown.so.2 ABI
+ $flags |= 0x00400000;
+ }
+
+ return Text::Markdown::Discount::markdown($t, $flags);
}
}
}