Extends
Properties
blockTypestatic
#
Node type to use when the transclusion is a block
Properties:
| Type | Description |
|---|---|
| string |
cellTypestatic
#
Node type to use when the transclusion is cellable
Properties:
| Type | Description |
|---|---|
| string |
inlineTypestatic
#
Node type to use when the transclusion is inline
Properties:
| Type | Description |
|---|---|
| string |
Methods
getPartsList() → {Array.<Object>}
#
Get a simplified description of the transclusion's parts.
Returns:
List of objects with either template or content properties
getSingleTemplateName() → {string|undefined}
#
undefined}
#
Get the name of the template if it's a single template transclusion
Returns:
Name of the template, undefined if not a single template transclusion
- Type
-
string
|
undefined
getSingleTemplatePart() → {Object|undefined}
#
undefined}
#
Get the transclusion's template part if it's a single template transclusion
Returns:
Object with template properties, undefined if not a single template transclusion
- Type
-
Object
|
undefined
getWikitext(skipParameters) → {string}
#
Wrapper for static method, ve.dm.MWTransclusionNode.static.getWikitext above.
Parameters:
| Name | Type | Description |
|---|---|---|
skipParameters |
boolean | Exclude parameters from result |
Returns:
Wikitext
- Type
- string
ve.dm.MWTransclusionNode.static.getWikitext above.
isSingleTemplate([allowedTemplates]) → {boolean}
#
Check if transclusion contains only a single template.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
allowedTemplates |
string | Array.<string> |
optional |
Names of templates to allow, omit to allow any template name |
Returns:
Transclusion only contains a single template, which is one of the ones in templates
- Type
- boolean
onAttributeChange(key, from, to)
#
Handle attribute change events.
Parameters:
| Name | Type | Description |
|---|---|---|
key |
string | Attribute key |
from |
string | Old value |
to |
string | New value |
cloneElement()static
#
escapeParameter(param) → {string}static
#
Escape a template parameter. Helper function for #getWikitext.
Parameters:
| Name | Type | Description |
|---|---|---|
param |
string | Parameter value |
Returns:
Escaped parameter value
- Type
- string
getWikitext(content, [skipParameters]) → {string}static
#
Recreate the wikitext for this transclusion, possibly containing multiple template invocations, mixed with raw wikitext snippets.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
content |
Object | MW data content |
||
skipParameters |
boolean |
optional |
false | Exclude parameters from result |
Returns:
Wikitext
- Type
- string
Recreate the wikitext for this transclusion, possibly containing multiple template invocations, mixed with raw wikitext snippets.