Module:Wikitext Parsing/doc: Difference between revisions
Appearance
m 1 revision imported |
Remove unused Wikipedia category assignments |
||
| (One intermediate revision by one other user not shown) | |||
| Line 1: | Line 1: | ||
== ParseTemplates == | == ParseTemplates == | ||
<code>ParseTemplates(InputText, dontEscape)</code> will attempt to parse all <code><nowiki>{{Templates}}</nowiki></code> on a page, handling multiple factors such as <code><nowiki></nowiki></code> and <code><nowiki>{{{Variables}}}</nowiki></code> 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: | |||
<code>ParseTemplates(InputText, dontEscape)</code> will attempt to parse all <code><nowiki>{{Templates}}</nowiki></code> on a page, handling multiple factors such as <code><nowiki> | |||
* '''Args''': A key-value set of arguments, not in order | * '''Args''': A key-value set of arguments, not in order | ||
* '''ArgOrder''': A list of keys in the order they appear in the template | * '''ArgOrder''': A list of keys in the order they appear in the template | ||
Latest revision as of 14:40, 16 September 2026
ParseTemplates
[edit source]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.