< Manual:Hooks
ParserAfterTidy | |
---|---|
Available from version 1.5.0 Used to add some final processing to the fully-rendered page output | |
Define function: | public static function onParserAfterTidy( Parser $parser, &$text ) { ... }
|
Attach hook: | In extension.json:
{
"Hooks": {
"ParserAfterTidy": "MyExtensionHooks::onParserAfterTidy"
}
}
|
Called from: | File(s): parser/Parser.php |
Interface: | ParserAfterTidyHook.php |
For more information about attaching hooks, see Manual:Hooks
For examples of extensions using this hook, see Category:ParserAfterTidy extensions.
Details
$parser
:Parser
object. Can be used to manually parse a portion of wiki text from the$text
.&$text
: Represents the text for page.
This hook is commonly used to re-introduce content that was earlier embedded by an extension during page rendering, either encoded or represented by a marker, by searching for it and replacing it with HTML content. Such a technique allows MediaWiki extensions to output HTML that isn't mangled by the parser, e.g., blacklisted HTML tags. See tag extension example
See also
- ParserBeforeStrip
- ParserAfterStrip
- InternalParseBeforeLinks
- ParserBeforeTidy
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.