Jump to content
Wikipedia The Free Encyclopedia

Module:Wikitext Parsing/doc

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Aidan9382 (talk | contribs) at 19:17, 16 March 2023 (bit of rewording, remove part about excessiveness (could serve a proper purpose)). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision .Revision as of 19:17, 16 March 2023 by Aidan9382 (talk | contribs) (bit of rewording, remove part about excessiveness (could serve a proper purpose))
This is a documentation subpage for Module:Wikitext Parsing.
It may contain usage information, categories and other content that is not part of the original module page.


This module is to do with the rare processing error involved in functions like Module:Transcluder's getParameters() or Module:Template parameter value, which intend to parse the raw wikitext of a page. The primary function, EscapeEscapedText, will run any content within certain tags (<nowiki>, <pre>, <syntaxhighlight>, <source>) that disable processing through mw.text.nowiki and remove HTML comments to avoid irrelevant text being processed by modules, allowing tricky syntax to be parsed through more basic means.

The primary function has a second parameter, keepComments, which will pass the content of HTML comments through mw.text.nowiki instead of removing them entirely if set to true. Only exists in case that would be wanted for whatever reason. If you aren't sure, don't set it.

This module is not to be used in template invocations, as there's no use in doing so. All text will be escaped by MediaWiki before reaching the module anyways. Attempting to use it directly via a template will lead to an error message.

Shortfalls: Currently unsure about the situation of <includeonly>...</includeonly> and how it's handled during processing, so it isn't considered by the module yet, though this isn't likely to matter much... I hope. Also, any module using this should consider using mw.text.decode to correct their output, though this will also decode any input that was encoded but not inside a no-processing tag, which likely isn't a significant issue but still something worth considering.


AltStyle によって変換されたページ (->オリジナル) /