1 We should support SVG. In particular:
3 * We could support rendering SVGs to PNGs when compiling the wiki. Not all browsers support SVG yet.
5 * We could support editing SVGs via the web interface. SVG can contain unsafe content such as scripting, so we would need to whitelist safe markup.
11 I'm allowing for inline SVG on my own installation. I've patched my
12 copy of htmlscrubber.pm to allow safe MathML and SVG elements (as
13 implemented in html5lib). <del datetime="2008-03-20T23:04-05:00">Here's a patch
14 if anyone else is interested.</del>
15 <ins datetime="2008-03-20T23:05-05:00">Actually, that patch wasn't quite
16 right. I'll post a new one when it's working properly.</ins> --[[JasonBlevins]]
20 I'd like to hear what people think about the following:
22 1. Including whitelists of elements and attributes for SVG and MathML in
23 htmlscrubber. See my current [htmlscrubber.pm][] and the [diff][]
24 from the current trunk.
26 2. Creating a whitelist of safe SVG (and maybe even HTML) style
27 attributes such as `fill`, `stroke-width`, etc.
29 This is how the [sanitizer][] in html5lib works. It shouldn't be too
30 hard to translate the relevant parts to Perl.
32 --[[JasonBlevins]], March 21, 2008 11:39 EDT
34 [htmlscrubber.pm]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blob;f=IkiWiki/Plugin/htmlscrubber.pm;hb=fa9045c07efce434f24edb05b542c88815452873
35 [diff]: http://xbeta.org/gitweb/?p=xbeta/ikiwiki.git;a=blobdiff;f=IkiWiki/Plugin/htmlscrubber.pm;h=35c546620f8f58eb50c72783f11d422b06de93ca;hp=3bdaccea119ec0e1b289a0da2f6d90e2219b8d66;hb=fa9045c07efce434f24edb05b542c88815452873;hpb=be0b4f603f918444b906e42825908ddac78b7073
36 [sanitizer]: http://code.google.com/p/html5lib/source/browse/trunk/ruby/lib/html5/sanitizer.rb
40 Another problem is that [HTML::Scrubber][] converts all tags to lowercase.
41 Some SVG elements, such as viewBox, are mixed case. It seems that
42 properly handling SVG might require moving to a different sanitizer.
43 It seems that [HTML::Sanitizer][] has functions for sanitizing XHTML.
44 Any thoughts? --[[JasonBlevins]], March 21, 2008 13:54 EDT
46 [HTML::Scrubber]: http://search.cpan.org/~podmaster/HTML-Scrubber-0.08/Scrubber.pm
47 [HTML::Sanitizer]: http://search.cpan.org/~nesting/HTML-Sanitizer-0.04/Sanitizer.pm