ILIAS
Release_3_10_x_branch Revision 61812
|
Public Member Functions | |
Parser () | |
#@- | |
firstCallInit () | |
Do various kinds of initialisation on the first call of the parser. | |
setOutputType ($ot) | |
uniqPrefix () | |
Accessor for mUniqPrefix. | |
parse ($text, &$title, $options, $linestart=true, $clearState=true, $revid=null) | |
Convert wikitext to HTML Do not call this function recursively. | |
recursiveTagParse ($text) | |
Recursive parser entry point that can be called from an extension tag hook. | |
preprocess ($text, $title, $options) | |
Expand templates and variables in the text, producing valid, static wikitext. | |
& | getTitle () |
getOptions () | |
getFunctionLang () | |
unstripForHTML ($text) | |
magicLinkCallback ($m) | |
makeLinkHolder (&$nt, $text= '', $query= '', $trail= '', $prefix= '') | |
Make a link placeholder. | |
makeKnownLinkHolder ($nt, $text= '', $query= '', $trail= '', $prefix= '') | |
Render a forced-blue link inline; protect against double expansion of URLs if we're in a mode that prepends full URL prefixes to internal links. | |
armorLinks ($text) | |
Insert a NOPARSE hacky thing into any inline links in a chunk that's going to go through further parsing steps before inline URL expansion. | |
areSubpagesAllowed () | |
Return true if subpage links should be expanded on this page. | |
getCommon ($st1, $st2) | |
openList ($char) | |
nextItem ($char) | |
closeList ($char) | |
findColonNoLinks ($str, &$before, &$after) | |
Split up a string on ':', ignoring any occurences inside tags to prevent illegal overlapping. | |
fetchTemplate ($title) | |
Fetch the unparsed text of a template and register a reference to it. | |
interwikiTransclude ($title, $action) | |
Transclude an interwiki link. | |
fetchScaryTemplateMaybeFromCache ($url) | |
incrementIncludeSize ($type, $size) | |
Increment an include size counter. | |
stripNoGallery (&$text) | |
Detect NOGALLERY magic word and set a placeholder. | |
stripToc ($text) | |
Detect TOC magic word and set a placeholder. | |
preSaveTransform ($text, &$title, $user, $options, $clearState=true) | |
Transform wiki markup when saving a page by doing -> conversion, substitting signatures, {{subst:}} templates, etc. | |
validateSig ($text) | |
Check that the user's signature contains no bad XML. | |
cleanSig ($text, $parsing=false) | |
Clean up signature text. | |
cleanSigInSig ($text) | |
Strip ~~~, ~~~~ and ~~~~~ out of signatures. | |
startExternalParse (&$title, $options, $outputType, $clearState=true) | |
Set up some variables which are usually set up in parse() so that an external function can call some class members with confidence. | |
transformMsg ($text, $options) | |
Transform a MediaWiki message by replacing magic variables. | |
setHook ($tag, $callback) | |
Create an HTML-style tag, e.g. | |
setFunctionHook ($id, $callback, $flags=0) | |
Create a function, e.g. | |
getFunctionHooks () | |
Get all registered function hook identifiers. | |
replaceLinkHolders (&$text, $options=0) | |
Replace link placeholders with actual links, in the buffer Placeholders created in Skin::makeLinkObj() Returns an array of links found, indexed by PDBK: 0 - broken 1 - normal link 2 - stub $options is a bit field, RLH_FOR_UPDATE to select for update. | |
replaceLinkHoldersText ($text) | |
Replace link placeholders with plain text of links (not HTML-formatted). | |
renderPreTag ($text, $attribs) | |
Tag hook handler for 'pre'. | |
renderImageGallery ($text, $params) | |
Renders an image gallery from a text with one line per image. | |
makeImage ($nt, $options) | |
Parse image options text and use it to make an image. | |
disableCache () | |
Set a flag in the output object indicating that the content is dynamic and shouldn't be cached. | |
Title ($x=NULL) | |
#@- | |
Options ($x=NULL) | |
OutputType ($x=NULL) | |
getTags () | |
#@- | |
getSection ($text, $section, $deftext='') | |
This function returns the text of a section, specified by a number ($section). | |
replaceSection ($oldtext, $section, $text) | |
getRevisionTimestamp () | |
Get the timestamp associated with the current revision, adjusted for the default server-local timestamp. | |
setDefaultSort ($sort) | |
Mutator for $mDefaultSort. | |
getDefaultSort () | |
Accessor for $mDefaultSort Will use the title/prefixed title if none is set. |
Static Public Member Functions | |
tidy ($text) | |
Interface with html tidy, used if $wgUseTidy = true. | |
static | replaceUnusualEscapes ($url) |
Replace unusual URL escape codes with their equivalent characters. | |
static | createAssocArgs ($args) |
Clean up argument array - refactored in 1.9 so parserfunctions can use it, too. |
Private Member Functions | |
clearState () | |
Clear Parser state. | |
strip ($text, $state, $stripcomments=false, $dontstrip=array()) | |
Strips and renders nowiki, pre, math, hiero If $render is set, performs necessary rendering operations on plugins Returns the text, and fills an array with data needed in unstrip() | |
unstrip ($text, $state) | |
Restores pre, math, and other extensions removed by strip() | |
unstripNoWiki ($text, $state) | |
Always call this after unstrip() to preserve the order. | |
insertStripItem ($text, &$state) | |
Add an item to the strip state Returns the unique tag which must be inserted into the stripped text The tag will be replaced with the original text in unstrip() | |
doTableStuff ($text) | |
parse the wiki syntax used to render tables | |
internalParse ($text) | |
Helper function for parse() that transforms wiki markup into HTML. | |
& | doMagicLinks (&$text) |
Replace special strings like "ISBN xxx" and "RFC xxx" with magic external links. | |
doHeadings ($text) | |
Parse headers and return html. | |
doAllQuotes ($text) | |
Replace single quotes with HTML markup. | |
doQuotes ($text) | |
Helper function for doAllQuotes() | |
replaceExternalLinks ($text) | |
Replace external links. | |
replaceFreeExternalLinks ($text) | |
Replace anything that looks like a URL with a link. | |
maybeMakeExternalImage ($url) | |
make an image if it's allowed, either through the global option or through the exception | |
replaceInternalLinks ($s) | |
Process [[ ]] wikilinks. | |
maybeDoSubpageLink ($target, &$text) | |
Handle link to subpage if necessary. | |
closeParagraph () | |
#@+ Used by doBlockLevels() | |
doBlockLevels ($text, $linestart) | |
#@- | |
getVariableValue ($index) | |
Return value of a magic variable (like PAGENAME) | |
initialiseVariables () | |
initialise the magic variables (like CURRENTMONTHNAME) | |
replace_callback ($text, $callbacks) | |
parse any parentheses in format ((title|part|part)) and call callbacks to get a replacement text for any found piece | |
replaceVariables ($text, $args=array(), $argsOnly=false) | |
Replace magic variables, templates, and template arguments with the appropriate text. | |
variableSubstitution ($matches) | |
Replace magic variables. | |
braceSubstitution ($piece) | |
Return the text of a template, after recursively replacing any variables or templates within the template. | |
argSubstitution ($matches) | |
Triple brace replacement – used for template arguments. | |
formatHeadings ($text, $isMain=true) | |
This function accomplishes several tasks: 1) Auto-number headings if that option is enabled 2) Add an [edit] link to sections for logged in users who have enabled the option 3) Add a Table of contents on the top for users who have enabled the option 4) Auto-anchor headings. | |
pstPass2 ($text, &$stripState, $user) | |
Pre-save transform helper function. | |
getUserSig (&$user) | |
Fetch the user's signature text, if any, and normalize to validated, ready-to-insert wikitext. | |
replaceLinkHoldersTextCallback ($matches) | |
attributeStripCallback (&$text, $args) | |
#@+ Callback from the Sanitizer for expanding items found in HTML attribute values, so they can be safely tested and escaped. | |
extractSections ($text, $section, $mode, $newtext='') | |
#@- |
Static Private Member Functions | |
getRandomString () | |
Get a random string. | |
extractTagsAndParams ($elements, $text, &$matches, $uniq_prefix= '') | |
Replaces all occurrences of HTML-style comments and the given tags in the text with a random marker and returns teh next text. | |
externalTidy ($text) | |
Spawn an external HTML tidy process and get corrected markup back from it. | |
internalTidy ($text) | |
Use the HTML tidy PECL extension to use the tidy library in-process, saving the overhead of spawning a new process. | |
static | replaceUnusualEscapesCallback ($matches) |
Callback function used in replaceUnusualEscapes(). |
Private Attributes | |
$mTagHooks | |
#@+ |
Definition at line 90 of file Parser.php.
Parser::areSubpagesAllowed | ( | ) |
Return true if subpage links should be expanded on this page.
Definition at line 1896 of file Parser.php.
|
private |
Triple brace replacement – used for template arguments.
Definition at line 3333 of file Parser.php.
Parser::armorLinks | ( | $text | ) |
Insert a NOPARSE hacky thing into any inline links in a chunk that's going to go through further parsing steps before inline URL expansion.
In particular this is important when using action=render, which causes full URLs to be included.
Oh man I hate our multi-layer parser!
string | more-or-less HTML |
Definition at line 1887 of file Parser.php.
|
private |
#@+ Callback from the Sanitizer for expanding items found in HTML attribute values, so they can be safely tested and escaped.
string | $text | |
array | $args |
Definition at line 4502 of file Parser.php.
|
private |
Return the text of a template, after recursively replacing any variables or templates within the template.
array | $piece | The parts of the template $piece['text']: matched text $piece['title']: the title, i.e. the part before the | $piece['parts']: the parameter array |
Definition at line 2897 of file Parser.php.
Parser::cleanSig | ( | $text, | |
$parsing = false |
|||
) |
Clean up signature text.
1) Strip ~~~, ~~~~ and ~~~~~ out of signatures
string | $text | |
$parsing | Whether we're cleaning (preferences save) or parsing |
Definition at line 3807 of file Parser.php.
Parser::cleanSigInSig | ( | $text | ) |
Strip ~~~, ~~~~ and ~~~~~ out of signatures.
string | $text |
Definition at line 3828 of file Parser.php.
|
private |
Clear Parser state.
Prefix for temporary replacement strings for the multipass parser. should never appear in input as it's disallowed in XML. Using it at the front also gives us a little extra robustness since it shouldn't match when butted up against identifier-like string constructs.
Definition at line 190 of file Parser.php.
Parser::closeList | ( | $char | ) |
Definition at line 2034 of file Parser.php.
|
private |
#@+ Used by doBlockLevels()
Definition at line 1978 of file Parser.php.
|
static |
Clean up argument array - refactored in 1.9 so parserfunctions can use it, too.
Definition at line 2864 of file Parser.php.
Parser::disableCache | ( | ) |
Set a flag in the output object indicating that the content is dynamic and shouldn't be cached.
Definition at line 4489 of file Parser.php.
|
private |
Replace single quotes with HTML markup.
Definition at line 1119 of file Parser.php.
|
private |
#@-
Make lists from lines starting with ':', '*', '#', etc.
Definition at line 2056 of file Parser.php.
|
private |
Parse headers and return html.
Definition at line 1102 of file Parser.php.
|
private |
Replace special strings like "ISBN xxx" and "RFC xxx" with magic external links.
Definition at line 1043 of file Parser.php.
|
private |
Helper function for doAllQuotes()
Definition at line 1136 of file Parser.php.
|
private |
parse the wiki syntax used to render tables
Definition at line 792 of file Parser.php.
|
staticprivate |
Spawn an external HTML tidy process and get corrected markup back from it.
Definition at line 716 of file Parser.php.
|
private |
#@-
Break wikitext input into sections, and either pull or replace some particular section's text.
External callers should use the getSection and replaceSection methods.
$text | Page wikitext |
$section | Numbered section. 0 pulls the text before the first heading; other numbers will pull the given section along with its lower-level subsections. |
$mode | One of "get" or "replace" |
$newtext | Replacement text for section data. |
Definition at line 4540 of file Parser.php.
|
staticprivate |
Replaces all occurrences of HTML-style comments and the given tags in the text with a random marker and returns teh next text.
The output parameter $matches will be an associative array filled with data in the form: 'UNIQ-xxxxx' => array( 'element', 'tag content', array( 'param' => 'x' ), '<element param="x">tag content</element>' ) )
$elements | list of element names. Comments are always extracted. |
$text | Source text string. |
$uniq_prefix |
Definition at line 454 of file Parser.php.
Parser::fetchScaryTemplateMaybeFromCache | ( | $url | ) |
Definition at line 3303 of file Parser.php.
References wfMsg().
Parser::fetchTemplate | ( | $title | ) |
Fetch the unparsed text of a template and register a reference to it.
Definition at line 3259 of file Parser.php.
Parser::findColonNoLinks | ( | $str, | |
& | $before, | ||
& | $after | ||
) |
Split up a string on ':', ignoring any occurences inside tags to prevent illegal overlapping.
string | $str | the string to split |
string | &$before | set to everything before the ':' |
string | &$after | set to everything after the ':' return string the position of the ':', or false if none found |
Definition at line 2226 of file Parser.php.
Parser::firstCallInit | ( | ) |
Do various kinds of initialisation on the first call of the parser.
Definition at line 136 of file Parser.php.
|
private |
This function accomplishes several tasks: 1) Auto-number headings if that option is enabled 2) Add an [edit] link to sections for logged in users who have enabled the option 3) Add a Table of contents on the top for users who have enabled the option 4) Auto-anchor headings.
It loops through all headlines, collects the necessary data, then splits up the string and re-inserts the newly formatted headlines.
string | $text | |
boolean | $isMain |
Definition at line 3417 of file Parser.php.
Parser::getCommon | ( | $st1, | |
$st2 | |||
) |
Definition at line 1990 of file Parser.php.
Parser::getDefaultSort | ( | ) |
Accessor for $mDefaultSort Will use the title/prefixed title if none is set.
Definition at line 4712 of file Parser.php.
Parser::getFunctionHooks | ( | ) |
Get all registered function hook identifiers.
Definition at line 3966 of file Parser.php.
Parser::getFunctionLang | ( | ) |
Definition at line 431 of file Parser.php.
Parser::getOptions | ( | ) |
Definition at line 429 of file Parser.php.
|
staticprivate |
Get a random string.
Definition at line 424 of file Parser.php.
Parser::getRevisionTimestamp | ( | ) |
Get the timestamp associated with the current revision, adjusted for the default server-local timestamp.
Definition at line 4670 of file Parser.php.
Parser::getSection | ( | $text, | |
$section, | |||
$deftext = '' |
|||
) |
This function returns the text of a section, specified by a number ($section).
A section is text under a heading like == Heading == or <h1>Heading</h1>, or the first section before any such heading (section 0).
If a section contains subsections, these are also returned.
$text | String: text to look in |
$section | Integer: section number |
$deftext,: | default to return if section is not found |
Definition at line 4658 of file Parser.php.
Parser::getTags | ( | ) |
#@-
#@+ Accessor
Definition at line 4521 of file Parser.php.
& Parser::getTitle | ( | ) |
Definition at line 428 of file Parser.php.
|
private |
Fetch the user's signature text, if any, and normalize to validated, ready-to-insert wikitext.
User | $user |
Definition at line 3762 of file Parser.php.
|
private |
Return value of a magic variable (like PAGENAME)
Some of these require message or data lookups and can be expensive to check many times.
Definition at line 2387 of file Parser.php.
Parser::incrementIncludeSize | ( | $type, | |
$size | |||
) |
Increment an include size counter.
string | $type | The type of expansion |
integer | $size | The size of the text |
Definition at line 3359 of file Parser.php.
|
private |
initialise the magic variables (like CURRENTMONTHNAME)
Definition at line 2581 of file Parser.php.
|
private |
Add an item to the strip state Returns the unique tag which must be inserted into the stripped text The tag will be replaced with the original text in unstrip()
Definition at line 673 of file Parser.php.
|
private |
Helper function for parse() that transforms wiki markup into HTML.
Only called for $mOutputType == OT_HTML.
Definition at line 985 of file Parser.php.
|
staticprivate |
Use the HTML tidy PECL extension to use the tidy library in-process, saving the overhead of spawning a new process.
Currently written to the PHP 4.3.x version of the extension, may not work on PHP 5.
'pear install tidy' should be able to compile the extension module.
Definition at line 767 of file Parser.php.
Parser::interwikiTransclude | ( | $title, | |
$action | |||
) |
Transclude an interwiki link.
Definition at line 3290 of file Parser.php.
Parser::magicLinkCallback | ( | $m | ) |
Definition at line 1060 of file Parser.php.
References wfMsg().
Parser::makeImage | ( | $nt, | |
$options | |||
) |
Parse image options text and use it to make an image.
Definition at line 4390 of file Parser.php.
Parser::makeKnownLinkHolder | ( | $nt, | |
$text = '' , |
|||
$query = '' , |
|||
$trail = '' , |
|||
$prefix = '' |
|||
) |
Render a forced-blue link inline; protect against double expansion of URLs if we're in a mode that prepends full URL prefixes to internal links.
Since this little disaster has to split off the trail text to avoid breaking URLs in the following text without breaking trails on the wiki links, it's been made into a horrible function.
Title | $nt | |
string | $text | |
string | $query | |
string | $trail | |
string | $prefix |
Definition at line 1868 of file Parser.php.
Parser::makeLinkHolder | ( | & | $nt, |
$text = '' , |
|||
$query = '' , |
|||
$trail = '' , |
|||
$prefix = '' |
|||
) |
Make a link placeholder.
The text returned can be later resolved to a real link with replaceLinkHolders(). This is done for two reasons: firstly to avoid further parsing of interwiki links, and secondly to allow all existence checks and article length checks (for stub links) to be bundled into a single query.
Definition at line 1827 of file Parser.php.
|
private |
Handle link to subpage if necessary.
string | $target | the source of the link |
string | &$text | the link text, modified as necessary |
Definition at line 1909 of file Parser.php.
|
private |
make an image if it's allowed, either through the global option or through the exception
Reimplemented in ilMWParserAdapter.
Definition at line 1509 of file Parser.php.
Parser::nextItem | ( | $char | ) |
Definition at line 2018 of file Parser.php.
Parser::openList | ( | $char | ) |
Definition at line 2003 of file Parser.php.
References $result.
Parser::Options | ( | $x = NULL | ) |
Definition at line 4514 of file Parser.php.
Parser::OutputType | ( | $x = NULL | ) |
Definition at line 4515 of file Parser.php.
Parser::parse | ( | $text, | |
& | $title, | ||
$options, | |||
$linestart = true , |
|||
$clearState = true , |
|||
$revid = null |
|||
) |
Convert wikitext to HTML Do not call this function recursively.
string | $text | Text we want to parse |
Title | &$title | A title object |
array | $options | |
boolean | $linestart | |
boolean | $clearState | |
int | $revid | number to pass in {{REVISIONID}} |
First pass–just handle <nowiki> sections, pass the rest off to internalParse() which does all the real work.
Definition at line 274 of file Parser.php.
Parser::Parser | ( | ) |
#@-
Constructor
Definition at line 126 of file Parser.php.
Parser::preprocess | ( | $text, | |
$title, | |||
$options | |||
) |
Expand templates and variables in the text, producing valid, static wikitext.
Also removes comments.
Definition at line 400 of file Parser.php.
Parser::preSaveTransform | ( | $text, | |
& | $title, | ||
$user, | |||
$options, | |||
$clearState = true |
|||
) |
Transform wiki markup when saving a page by doing
->
conversion, substitting signatures, {{subst:}} templates, etc.
string | $text | the text to transform |
Title | &$title | the Title object for the current article |
User | &$user | the User object describing the current user |
ParserOptions | $options | parsing options |
bool | $clearState | whether to clear the parser state first |
Definition at line 3666 of file Parser.php.
|
private |
Pre-save transform helper function.
Definition at line 3690 of file Parser.php.
Parser::recursiveTagParse | ( | $text | ) |
Recursive parser entry point that can be called from an extension tag hook.
Definition at line 386 of file Parser.php.
Parser::renderImageGallery | ( | $text, | |
$params | |||
) |
Renders an image gallery from a text with one line per image.
text labels may be given by using |-style alternative text. E.g. Image:one.jpg|The number "1" Image:tree.jpg|A tree given as text will return the HTML of a gallery with two images, labeled 'The number "1"' and 'A tree'.
Definition at line 4323 of file Parser.php.
Parser::renderPreTag | ( | $text, | |
$attribs | |||
) |
Tag hook handler for 'pre'.
Definition at line 4304 of file Parser.php.
|
private |
parse any parentheses in format ((title|part|part)) and call callbacks to get a replacement text for any found piece
string | $text | The text to parse |
array | $callbacks | rules in form: '{' => array( # opening parentheses 'end' => '}', # closing parentheses 'cb' => array(2 => callback, # replacement callback to call if {{..}} is found 3 => callback # replacement callback to call if {{{..}}} is found ) ) 'min' => 2, # Minimum parenthesis count in cb 'max' => 3, # Maximum parenthesis count in cb |
Definition at line 2610 of file Parser.php.
|
private |
Replace external links.
Note: this is all very hackish and the order of execution matters a lot. Make sure to run maintenance/parserTests.php if you change this code.
Definition at line 1306 of file Parser.php.
|
private |
Replace anything that looks like a URL with a link.
Definition at line 1391 of file Parser.php.
|
private |
Process [[ ]] wikilinks.
Strip the whitespace Category links produce, see bug 87
Definition at line 1529 of file Parser.php.
Parser::replaceLinkHolders | ( | & | $text, |
$options = 0 |
|||
) |
Replace link placeholders with actual links, in the buffer Placeholders created in Skin::makeLinkObj() Returns an array of links found, indexed by PDBK: 0 - broken 1 - normal link 2 - stub $options is a bit field, RLH_FOR_UPDATE to select for update.
Definition at line 3979 of file Parser.php.
Parser::replaceLinkHoldersText | ( | $text | ) |
Replace link placeholders with plain text of links (not HTML-formatted).
string | $text |
Definition at line 4268 of file Parser.php.
|
private |
array | $matches |
Definition at line 4286 of file Parser.php.
Parser::replaceSection | ( | $oldtext, | |
$section, | |||
$text | |||
) |
|
static |
Replace unusual URL escape codes with their equivalent characters.
string |
Definition at line 1479 of file Parser.php.
|
staticprivate |
Callback function used in replaceUnusualEscapes().
Replaces unusual URL escape codes with their equivalent character
Definition at line 1490 of file Parser.php.
|
private |
Replace magic variables, templates, and template arguments with the appropriate text.
Templates are substituted recursively, taking care to avoid infinite loops.
Note that the substitution depends on value of $mOutputType: OT_WIKI: only {{subst:}} templates OT_MSG: only magic variables OT_HTML: all templates and magic variables
string | $tex | The text to transform |
array | $args | Key-value pairs representing template parameters to substitute |
bool | $argsOnly | Only do argument (triple-brace) expansion, not double-brace expansion |
Definition at line 2784 of file Parser.php.
Parser::setDefaultSort | ( | $sort | ) |
Mutator for $mDefaultSort.
$sort | New value |
Definition at line 4702 of file Parser.php.
Parser::setFunctionHook | ( | $id, | |
$callback, | |||
$flags = 0 |
|||
) |
Create a function, e.g.
{{sum:1|2|3}} The callback function should have the form: function myParserFunction( &$parser, $arg1, $arg2, $arg3 ) { ... }
The callback may either return the text result of the function, or an array with the text in element 0, and a number of flags in the other elements. The names of the flags are specified in the keys. Valid flags are: found The text returned is valid, stop processing the template. This is on by default. nowiki Wiki markup in the return value should be escaped noparse Unsafe HTML tags should not be stripped, etc. noargs Don't replace triple-brace arguments in the return value isHTML The returned text is HTML, armour it against wikitext transformation
string | $id | The magic word ID |
mixed | $callback | The callback function (and object) to use |
integer | $flags | a combination of the following flags: SFH_NO_HASH No leading hash, i.e. {{plural:...}} instead of {{if:...}} |
Definition at line 3931 of file Parser.php.
Parser::setHook | ( | $tag, | |
$callback | |||
) |
Create an HTML-style tag, e.g.
<yourtag>special text</yourtag> The callback should have the following form: function myParserHook( $text, $params, &$parser ) { ... }
Transform and return $text. Use $parser for any required context, e.g. use $parser->getTitle() and $parser->getOptions() not $wgTitle or $wgOut->mParserOptions
mixed | $tag | The tag to use, e.g. 'hook' for <hook> |
mixed | $callback | The callback function (and object) to use for the tag |
Definition at line 3899 of file Parser.php.
Parser::setOutputType | ( | $ot | ) |
Parser::startExternalParse | ( | & | $title, |
$options, | |||
$outputType, | |||
$clearState = true |
|||
) |
Set up some variables which are usually set up in parse() so that an external function can call some class members with confidence.
Definition at line 3838 of file Parser.php.
|
private |
Strips and renders nowiki, pre, math, hiero If $render is set, performs necessary rendering operations on plugins Returns the text, and fills an array with data needed in unstrip()
StripState | $state | |
bool | $stripcomments | when set, HTML comments will be stripped in addition to other tags. This is important for section editing, where these comments cause confusion when counting the sections in the wikisource |
array | dontstrip contains tags which should not be stripped; used to prevent stipping of <gallery> when saving (fixes bug 2700) |
Definition at line 533 of file Parser.php.
Parser::stripNoGallery | ( | & | $text | ) |
Detect NOGALLERY magic word and set a placeholder.
Definition at line 3371 of file Parser.php.
Parser::stripToc | ( | $text | ) |
Detect TOC magic word and set a placeholder.
Definition at line 3381 of file Parser.php.
|
static |
Interface with html tidy, used if $wgUseTidy = true.
If tidy isn't able to correct the markup, the original will be returned in all its glory with a warning comment appended.
Either the external tidy program or the in-process tidy extension will be used depending on availability. Override the default $wgTidyInternal setting to disable the internal if it's not working.
string | $text | Hideous HTML input |
Definition at line 693 of file Parser.php.
Parser::Title | ( | $x = NULL | ) |
#@-
#@+ Accessor/mutator
Definition at line 4513 of file Parser.php.
Parser::transformMsg | ( | $text, | |
$options | |||
) |
Transform a MediaWiki message by replacing magic variables.
string | $text | the text to transform |
ParserOptions | $options | options |
Definition at line 3855 of file Parser.php.
Parser::uniqPrefix | ( | ) |
|
private |
Restores pre, math, and other extensions removed by strip()
always call unstripNoWiki() after this one
Definition at line 645 of file Parser.php.
Parser::unstripForHTML | ( | $text | ) |
Definition at line 662 of file Parser.php.
|
private |
Always call this after unstrip() to preserve the order.
Definition at line 655 of file Parser.php.
Parser::validateSig | ( | $text | ) |
Check that the user's signature contains no bad XML.
string | $text |
Definition at line 3793 of file Parser.php.
|
private |
Replace magic variables.
Definition at line 2830 of file Parser.php.
Parser::$mArgStack |
Definition at line 101 of file Parser.php.
Parser::$mAutonumber |
Definition at line 100 of file Parser.php.
Parser::$mDefaultSort |
Definition at line 103 of file Parser.php.
Parser::$mDTopen |
Definition at line 100 of file Parser.php.
Parser::$mFunctionHooks |
Definition at line 97 of file Parser.php.
Parser::$mFunctionSynonyms |
Definition at line 97 of file Parser.php.
Parser::$mIncludeCount |
Definition at line 101 of file Parser.php.
Parser::$mIncludeSizes |
Definition at line 103 of file Parser.php.
Parser::$mInPre |
Definition at line 101 of file Parser.php.
Parser::$mInterwikiLinkHolders |
Definition at line 102 of file Parser.php.
Parser::$mLastSection |
Definition at line 101 of file Parser.php.
Parser::$mLinkHolders |
Definition at line 102 of file Parser.php.
Parser::$mOptions |
Definition at line 111 of file Parser.php.
Parser::$mOutput |
Definition at line 100 of file Parser.php.
Parser::$mOutputType |
Definition at line 111 of file Parser.php.
Parser::$mRevIdForTs |
Definition at line 111 of file Parser.php.
Parser::$mRevisionId |
Definition at line 111 of file Parser.php.
Parser::$mRevisionTimestamp |
Definition at line 111 of file Parser.php.
Parser::$mStripState |
Definition at line 100 of file Parser.php.
|
private |
#@+
Definition at line 97 of file Parser.php.
Parser::$mTemplatePath |
Definition at line 104 of file Parser.php.
Parser::$mTemplates |
Definition at line 104 of file Parser.php.
Parser::$mTitle |
Definition at line 111 of file Parser.php.
Parser::$mUniqPrefix |
Definition at line 102 of file Parser.php.
Parser::$mVariables |
Definition at line 97 of file Parser.php.
Parser::$ot |
Definition at line 111 of file Parser.php.
Referenced by setOutputType().
const Parser::VERSION = MW_PARSER_VERSION |
Definition at line 92 of file Parser.php.