Wikimedia:Raw HTML

Unlike most Wikimedia wikis, wikimediafoundation.org allows raw HTML to be inserted into wiki pages by editors.[1] This is accomplished using the <html></html> tags. For example, the <style> tag would typically be banned on a Wikimedia wiki. But the following code works on this wiki:

<html>
<style type="text/css" media="all">
/* Make all paragraphs bold */
p { font-weight:bold; }
</style>
</html>

Editors should note that the code within <html> tags is typically not sanitized or cleaned up by MediaWiki, so invalid code can easily break pages.

Raw HTML should be used only if absolutely necessary. If it's possible to use standard wiki markup, that should always be preferred. Raw HTML makes it more difficult for other wikis to re-use code from this wiki, it poses problems with invalid code input and output (as mentioned above), it doesn't accept template parameters, it bypasses links tracking tables, etc.

Notes

  1. Search for "wgRawHtml" in InitialiseSettings.php
Last modified on 16 May 2013, at 04:47