as noone seems to have documented this (at least i couldn’t find it) i’ll go for it:
i probably could have written a mediawiki extension but i’m too stupid for that. so we’ll have to live with a mediawiki hack. working example.
do the following:
- find the file Sanitizer.php in the folder /includes of your mediawiki installation
- find the function removeHTMLtags in that file. below that you’ll find a list of whitelisted HTML tags. add the tag embed to the list.
- find the function setupAttributeWhitelist in the same file. several lines below you will find HTML-attributes being whitelisted for each HTML tag. so you add a new line (maybe below the line that defines span):
’embed’ => array( ‘style’, ‘id’, ‘type’, ‘src’, ‘width’, ‘height’ ),
take care to replace the typographic ‘-quotes by straight ones when doing copy&paste. (wordpress converts the quotes on this blog, so you need to convert them back.)
you’re done. now you can copy the HTML-code provided by google or youtube into your wiki textbox and it’ll work. (make sure to make backups and document so you know what you’ve changed. when upgrading you’ll have to repeat the process. no warranties for possibile security leaks resulting from the hack.)
update april 2007: i just tested, this hack also works with mediawiki 1.9.2, just that you need to add embed to $htmlpairs. (note: in case the embed-code you want to use has the format <embed /> you now have to convert it to <embed> </embed> before posting it to your wiki.) i also would recommend to paste the last line of code near br instead of span (the file has got rearranged a bit).