function clearState() {
$this->mOutput = new ParserOutput;
$this->mAutonumber = 0;
- $this->mLastSection = "";
+ $this->mLastSection = '';
$this->mDTopen = false;
$this->mVariables = false;
$this->mIncludeCount = array();
* to internalParse() which does all the real work.
*
* @access private
+ * @param string $text Text we want to parse
+ * @param Title &$title A title object
+ * @param array $options
+ * @param boolean $linestart
+ * @param boolean $clearState
* @return ParserOutput a ParserOutput
*/
function parse( $text, &$title, $options, $linestart = true, $clearState = true ) {
# only if there is something before the space
'/(.) (?=\\?|:|;|!|\\302\\273)/i' => '\\1 \\2',
# french spaces, Guillemet-right
- "/(\\302\\253) /i"=>"\\1 ",
+ '/(\\302\\253) /i' => '\\1 ',
'/<hr *>/i' => '<hr />',
'/<br *>/i' => '<br />',
'/<center *>/i' => '<div class="center">',
*
* @access private
*/
-
function replaceInternalLinks( $s ) {
global $wgLang, $wgContLang, $wgLinkCache;
global $wgDisableLangConversion;
*
* It loops through all headlines, collects the necessary data, then splits up the
* string and re-inserts the newly formatted headlines.
+ *
+ * @param string $text
+ * @param boolean $isMain
* @access private
*/
- /* private */ function formatHeadings( $text, $isMain=true ) {
+ function formatHeadings( $text, $isMain=true ) {
global $wgInputEncoding, $wgMaxTocLevel, $wgContLang, $wgLinkHolders, $wgInterwikiLinkHolders;
$doNumberHeadings = $this->mOptions->getNumberHeadings();
function setSkin( &$x ) { $this->mSkin =& $x; }
- # Get parser options
- /* static */ function newFromUser( &$user ) {
+ /**
+ * Get parser options
+ * @static
+ */
+ function newFromUser( &$user ) {
$popts = new ParserOptions;
$popts->initialiseFromUser( $user );
return $popts;
}
- # Get user options
+ /** Get user options */
function initialiseFromUser( &$userInput ) {
global $wgUseTeX, $wgUseDynamicDates, $wgInterwikiMagic, $wgAllowExternalImages;
$fname = 'ParserOptions::initialiseFromUser';
$this->mShowToc = $user->getOption( 'showtoc' );
wfProfileOut( $fname );
}
-
-
}
/**
}
}
+/**
+ * Escape html tags
+ * Basicly replacing " > and < with HTML entities ( ", >, <)
+ *
+ * @param string $in Text that might contain HTML tags
+ * @return string Escaped string
+ */
function wfEscapeHTMLTagsOnly( $in ) {
return str_replace(
array( '"', '>', '<' ),