Manual:Hooks/InternalParseBeforeSanitize

From mediawiki.org
InternalParseBeforeSanitize
Available from version 1.20.0
This hook is called during Parser's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings.
Define function:
public static function onInternalParseBeforeSanitize( Parser &$parser, &$text, StripState &$stripState ) { ... }
Attach hook: In extension.json:
{
	"Hooks": {
		"InternalParseBeforeSanitize": "MyExtensionHooks::onInternalParseBeforeSanitize"
	}
}
Called from: File(s): parser/Parser.php
Interface: InternalParseBeforeSanitizeHook.php

For more information about attaching hooks, see Manual:Hooks .
For examples of extensions using this hook, see Category:InternalParseBeforeSanitize extensions.


This hook is ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments.