Page MenuHomePhabricator

Prose.php

Authored By
bzimport
Nov 21 2014, 9:15 PM
Size
697 B
Referenced Files
None
Subscribers
None

Prose.php

<?php
$wgExtensionFunctions[] = "wfProseExtension";
function wfProseExtension() {
$GLOBALS['wgParser']->setHook("prose", "ProseExtension");
}
function ProseExtension( $text, $params=array(), $parser=null ) {
global $wgVersion;
$parsed = $parser->parse($text, $parser->mTitle, $parser->mOptions);
if (version_compare($wgVersion, "1.7alpha") >= 0) {
$attribs = Sanitizer::validateTagAttributes($params, 'div');
} else {
$attribs = array();
}
if(isset( $attribs['class'])) {
$attribs['class'] = 'prose ' . $attribs['class'];
} else {
$attribs['class'] = 'prose';
}
return wfOpenElement('div', $attribs) . "\n" . $parsed->getText() . "\n</div>";
}
?>

File Metadata

Mime Type
text/x-php
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2440
Default Alt Text
Prose.php (697 B)

Event Timeline