diff options
-rw-r--r-- | IkiWiki/Plugin/mdwn.pm | 13 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/escaped_style_tag_becomes_elyts.mdwn | 4 |
3 files changed, 14 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); } } } diff --git a/debian/changelog b/debian/changelog index a92e3711e..08e320f30 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,6 +7,7 @@ ikiwiki (3.20170112) UNRELEASED; urgency=medium misconfigured nginx servers, and in general treat sessions with a set-but-empty name as if they were not signed in. * When the CGI fails, print the error to stderr, not "Died" + * mdwn: Don't mangle <style> into <elyts> under some circumstances -- Simon McVittie <smcv@debian.org> Sun, 14 May 2017 15:34:52 +0100 diff --git a/doc/bugs/escaped_style_tag_becomes_elyts.mdwn b/doc/bugs/escaped_style_tag_becomes_elyts.mdwn index 709542527..336e2ff95 100644 --- a/doc/bugs/escaped_style_tag_becomes_elyts.mdwn +++ b/doc/bugs/escaped_style_tag_becomes_elyts.mdwn @@ -28,3 +28,7 @@ discuss style markup several times. The first couple of times I saw this happen, I thought it was some sort of misguided anti-cross-site-scripting filter... --[[smcv]] + +> [[Fixed|done]] by passing the `MKD_NOSTYLE` flag to Discount instead. +> Unfortunately this isn't bound by [[!cpan Text::Markdown::Discount]] yet, +> so for now I'm hard-coding its numeric value. --[[smcv]] |