]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/escaped_style_tag_becomes_elyts.mdwn
google search plugin: use https for the search
[ikiwiki.git] / doc / bugs / escaped_style_tag_becomes_elyts.mdwn
1 When IkiWiki uses discount to implement [[plugins/mdwn]] rendering,
2 there is a workaround for <https://rt.cpan.org/Ticket/Display.html?id=74016>:
3
4 <pre><code>$t=~s/&lt;style/&lt;elyts/ig;
5 my $r=Text::Markdown::Discount::markdown($t);
6 $r=~s/&lt;elyts/&lt;style/ig;
7 </code></pre>
8
9 However, this workaround also applies to indented text or text in backticks:
10 if you write <code>there is a bug involving the \`&lt;style&gt;\` tag</code>,
11 or use indentation like
12
13 <pre><code>you can use this markup:
14
15     &lt;style type="text/css"&gt;...&lt;/style&gt;
16 </code></pre>
17
18 then that gets turned into `<elyts` in the source before passing through
19 `markdown`, comes out as `&lt;elyts` in the output HTML, and is rendered
20 as `<elyts` by the browser. This makes it quite difficult to talk about
21 HTML stylesheet markup on an IkiWiki instance (I had to use raw HTML in
22 this bug report's source to avoid the bug).
23
24 I think the side-effect of the workaround is more damaging than the actual bug
25 being worked around: I've never wanted to write inline style tags in the body of
26 a Markdown page (which isn't even valid HTML) but I have certainly wanted to
27 discuss style markup several times. The first couple of times I saw this happen,
28 I thought it was some sort of misguided anti-cross-site-scripting filter...
29
30 --[[smcv]]