From MediaWiki.org
Jump to: navigation, search
Language: English  • français
MediaWiki extensions manualManual:Extensions
Crystal Clear action run.png

Release status:Extension status beta

ImplementationTemplate:Extension#type Parser function
DescriptionTemplate:Extension#description Adds a parser function called #rawmsg for inserting raw HTML fragments into wiki pages.
Author(s)Template:Extension#username Jim R. Wilson (Jimbojwtalk)
Latest versionTemplate:Extension#version 0.1
MediaWikiTemplate:Extension#mediawiki 1.6.x, 1.9 - 1.17 (see talk)
Database changesTemplate:Extension#needs-updatephp No
LicenseTemplate:Extension#license The MIT License
Download RawMsg.php
ExampleTemplate:Extension#example see the Project Homepage
Hooks usedTemplate:Extension#hook

Translate the RawMsg extension if it is available at translatewiki.net

Check usage and version matrix.

The RawMsg extension adds a parser function called #rawmsg for inserting bits of raw HTML into wiki pages.


  1. For 1.17 and before download RawMsg, and be sure to rename the downloaded file to RawMsg.php. For 1.18 and above copy from RawMsg.php and RawMsg.i18n.php.
  2. Drop this script(s) in $IP/extensions/RawMsg
    Note: $IP is your MediaWiki install dir.
  3. Enable the extension by adding this line to your LocalSettings.php:
require_once( '$IP/extensions/RawMsg/RawMsg.php' );


The RawMsg parser function expects to be called in the following way:


Where message-name is the name of raw HTML message to insert.

For example, calling {{#rawmsg:test-pattern}} would grab the content of [[MediaWiki:rawmsg-test-pattern]] and insert the content directly into the page.

The MediaWiki namespace was chosen to house the HTML fragments so that only Sysops may edit them due to the XSS risk. Also, the messages must begin with 'rawmsg-' to decrease the likelihood that an obscure accidental MediaWiki article could be used as an XSS attack vector.

See Also[edit]