Extension:PlainHtml

From MediaWiki.org
Jump to navigation Jump to search


Warning Warning: This extension is dangerous because all contributors can include cookie-stealing JavaScript. DO NOT use it on wikis that everyone can edit.
MediaWiki extensions manual
OOjs UI icon advanced.svg
PlainHtml
Release status: beta
Implementation Tag
Description Sends text directly to user's internet browser.
Author(s) Adiblol
Latest version 0.1 (2008-01-23)
MediaWiki Extensions support required
License No license specified
Download see below
Translate the PlainHtml extension if it is available at translatewiki.net
Check usage and version matrix.

Source code[edit]

<?php
$wgExtensionFunctions[] = "wfPlainHtml";
 
function wfPlainHtml() {
 global $wgParser;
 $wgParser->setHook("plainhtml", "renderPlainhtml");
}
 
function renderPlainhtml($input, $argv, $parser) {
 return $input;
}
?>

Installation[edit]

  1. Create file called "plainhtml.php" in your extensions directory.
  2. Put source code into this file.
  3. Add following line to your LocalSettings.php file:
include('extensions/plainhtml.php');

Usage[edit]

Put any html code between <plainhtml> and </plainhtml> tags, e.g.:

<plainhtml>
<a href="#" onclick="alert('Hello! I am here!')">Click here.</a>
</plainhtml>

WARNING! This extension allows user to include script and it is dangerous for site's appearance. For user it is as dangerous as "normal" website!

Bugs[edit]

I haven't noticed any bugs, but it's beta version, however. Please write about all bugs you notice.