Skip to content

ParamTagToken (EN)

Bhsd edited this page Dec 13, 2025 · 3 revisions

Other Languages

Introduction

Content of extension tags that specify parameters line by line, used for the <dynamicpagelist> tag. This class inherits all the properties and methods of the MultiLineToken class.

✅ Available in the Mini and Browser versions.

Properties

Inherited properties from MultiLineToken

Methods

Inherited methods from MultiLineToken

cloneNode

Expand

returns: this
Deep clone the node.

// cloneNode (main)
var {
	firstChild: {lastChild},
} = Parser.parse('<dynamicpagelist>category = A</dynamicpagelist>');
assert.equal(lastChild, 'category = A');
assert.deepStrictEqual(lastChild.cloneNode(), lastChild);

lint

✅ Expand

returns: LintError[]
Report potential grammar errors.

// lint
var {firstChild: {lastChild}} = Parser.parse(`<dynamicpagelist>
category=<nowiki>a</nowiki>
</dynamicpagelist>`);
assert.equal(lastChild, '\ncategory=<nowiki>a</nowiki>\n');
assert.deepStrictEqual(lastChild.lint(), [
	{
		rule: 'no-ignored',
		severity: 'error',
		message: 'invalid parameter of <dynamicpagelist>',
		startLine: 1,
		startCol: 0,
		startIndex: 18,
		endLine: 1,
		endCol: 27,
		endIndex: 45,
	},
]);

({firstChild: {lastChild}} = Parser.parse(`<inputbox>
[type=create]
# {{template}}
</inputbox>`));
assert.equal(lastChild, '\n[type=create]\n# {{template}}\n');
assert.deepStrictEqual(lastChild.lint(), [
	{
		rule: 'no-ignored',
		severity: 'error',
		message: 'invalid parameter of <inputbox>',
		startLine: 1,
		startCol: 0,
		startIndex: 11,
		endLine: 1,
		endCol: 13,
		endIndex: 24,
		suggestions: [
			{
				desc: 'remove',
				range: [11, 24],
				text: '',
			},
		],
	},
	{
		rule: 'no-ignored',
		severity: 'error',
		message: 'invalid parameter of <inputbox>',
		startLine: 2,
		startCol: 0,
		startIndex: 25,
		endLine: 2,
		endCol: 14,
		endIndex: 39,
		suggestions: [
			{
				desc: 'remove',
				range: [25, 39],
				text: '',
			},
		],
	},
]);

Clone this wiki locally