Expand all

abstract ve.dm.MWTransclusionNode

Extends

Constructor

new ve.dm.MWTransclusionNode([element])abstract #

Parameters:

Name Type Attributes Description
element Object optional

Reference to element in linear model

Mixes in:
Source:
DataModel MediaWiki transclusion node.

Properties

blockTypestatic #

Node type to use when the transclusion is a block

Properties:

Type Description
string
Source:
Node type to use when the transclusion is a block

cellTypestatic #

Node type to use when the transclusion is cellable

Properties:

Type Description
string
Source:
Node type to use when the transclusion is cellable

inlineTypestatic #

Node type to use when the transclusion is inline

Properties:

Type Description
string
Source:
Node type to use when the transclusion is inline

Methods

getPartsList() → {Array.<Object>} #

Get a simplified description of the transclusion's parts.

Source:

Returns:

List of objects with either template or content properties

Type
Array.<Object>
Get a simplified description of the transclusion's parts.

getWikitext() → {string} #

Wrapper for static method, {@see ve.dm.MWTransclusionNode.static.getWikitext} above.

Source:

Returns:

Wikitext

Type
string
Wrapper for static method, {@see 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

Source:

Returns:

Transclusion only contains a single template, which is one of the ones in templates

Type
boolean
Check if transclusion contains only a single template.

onAttributeChange(key, from, to) #

Handle attribute change events.

Parameters:

Name Type Description
key string

Attribute key

from string

Old value

to string

New value

Source:
Handle attribute change events.

cloneElement()static #

escapeParameter(param) → {string}static #

Escape a template parameter. Helper function for #getWikitext.

Parameters:

Name Type Description
param string

Parameter value

Source:

Returns:

Escaped parameter value

Type
string
Escape a template parameter.

getWikitext(content) → {string}static #

Recreate the wikitext for this transclusion, possibly containing multiple template invocations, mixed with raw wikitext snippets.

Parameters:

Name Type Description
content Object

MW data content

Source:

Returns:

Wikitext

Type
string

Recreate the wikitext for this transclusion, possibly containing multiple template invocations, mixed with raw wikitext snippets.