Wikimedia:Raw HTML

From the Wikimedia Foundation
Revision as of 05:17, 27 December 2011 by MZMcBride (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 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 default wiki markup, that should always be preferred. Raw HTML makes it more difficult for other wikis to re-use the code, it poses problems with invalid code input and output (as mentioned above), it doesn't accept template parameters, etc.

Notes

  1. Search for "wgRawHtml" in InitialiseSettings.php