We can ask libdiscount not to elide <style> blocks, which means we
don't have to work around them.
# 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);
}
}
}
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
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]]