Wikimedia:Raw HTML

From the Wikimedia Foundation
Jump to: navigation, search

Unlike most Wikimedia wikis, 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:

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

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.


  1. Search for "wgRawHtml" in InitialiseSettings.php