-
Notifications
You must be signed in to change notification settings - Fork 2
OnlyincludeToken
bhsd edited this page Dec 11, 2023
·
13 revisions
被<onlyinclude>
和</onlyinclude>
包裹的内容。仅在嵌入时(即 Parser.parse(text, true)
)生效。
以下所有属性和方法在 Mini 和 Browser 版本中均不可用。
type: string
内部wikitext。
// innerText
var {firstChild} = Parser.parse('<onlyinclude>a</onlyinclude>', true);
assert.equal(firstChild, '<onlyinclude>a</onlyinclude>');
assert.strictEqual(firstChild.innerText, 'a');
firstChild.innerText = '[[a]]';
assert.equal(firstChild, '<onlyinclude>[[a]]</onlyinclude>');
assert.strictEqual(firstChild.firstChild.type, 'link');
returns: this
深拷贝节点。
// cloneNode
var {firstChild} = Parser.parse('<onlyinclude>a</onlyinclude>', true),
cloned = firstChild.cloneNode();
assert.equal(firstChild, '<onlyinclude>a</onlyinclude>');
assert.equal(cloned, '<onlyinclude>a</onlyinclude>');
assert.deepStrictEqual(cloned, firstChild);
对维基文本批量执行语法检查的命令行工具
用于维基文本的 ESLint 插件
A command-line tool that performs linting on Wikitext in bulk
ESLint plugin for Wikitext