Module:Wikitext Parsing/doc
Appearance
This is the documentation page for Module:Wikitext Parsing
ParseTemplates
[edit source]| File:Greek lc alpha icon.svg | This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. |
Lua error in Module:Effective_protection_level at line 64: attempt to index field 'TitleBlacklist' (a nil value).
-->
ParseTemplates(InputText, dontEscape) will attempt to parse all {{Templates}} on a page, handling multiple factors such as and {{{Variables}}} among other complex syntax. Due to the complexity of the function, it is considerably slow, and should be used carefully. The function returns a list of template objects in order of appearance, which have the following properties:
- Args: A key-value set of arguments, not in order
- ArgOrder: A list of keys in the order they appear in the template
- Children: A list of template objects that are contained within the existing template, in order of appearance. Only immediate children are listed
- Name: The name of the template
- Text: The raw text of the template
If the second parameter, dontEscape, is set to true, the inputted text won't be ran through the PrepareText function.