Manual:Hooks/InternalParseBeforeSanitize

From Linux Web Expert

InternalParseBeforeSanitize
<translate> Available from <tvar name=1><translate> version <tvar </tvar></translate>
<translate> Removed in <tvar name=1><translate> version <tvar (Gerrit change 860937)</tvar></translate>
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.
<translate> Define function:</translate>
public static function onInternalParseBeforeSanitize( Parser &$parser, &$text, StripState &$stripState ) { ... }
<translate> Attach hook:</translate> <translate> In <tvar name=1>extension.json</tvar>:</translate>
{
	"Hooks": {
		"InternalParseBeforeSanitize": "MediaWiki\\Extension\\MyExtension\\Hooks::onInternalParseBeforeSanitize"
	}
}
<translate> Called from:</translate> <translate> File(s):</translate> parser/Parser.php
<translate> Interface:</translate> InternalParseBeforeSanitizeHook.php

<translate> For more information about attaching hooks, see <tvar name=1>Manual:Hooks </tvar>.</translate>
<translate> For examples of extensions using this hook, see <tvar name=cat>Category:InternalParseBeforeSanitize extensions</tvar>.</translate>


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