Manual:Hooks/InternalParseBeforeSanitize

From Linux Web Expert

Revision as of 15:54, 17 November 2023 by imported>SamanthaNguyen (mark as removed in 1.40)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.