-
Notifications
You must be signed in to change notification settings - Fork 2
CategoryToken (EN)
bhsd edited this page Jul 11, 2024
·
12 revisions
Category. CategoryToken inherits all the properties and methods of the LinkBaseToken class which are not repeated here.
✅ Available in the Mini and Browser versions.
✅ Expand
type: 'category'
// type
var {firstChild} = Parser.parse('[[category:a]]');
assert.strictEqual(firstChild.type, 'category');
Expand
type: string
Sort key.
// sortkey (main)
var {firstChild} = Parser.parse('[[category:a|<|]]]');
assert.strictEqual(firstChild.sortkey, '<|]');
firstChild.sortkey = 'b';
assert.equal(firstChild, '[[category:a|b]]');
Expand
returns: this
Deep clone the node.
// cloneNode (main)
var {firstChild} = Parser.parse('[[category:a#b|c]]');
assert.deepStrictEqual(firstChild.cloneNode(), firstChild);
Expand
param: string
sort key
Set the sort key. Alias of LinkBaseToken.prototype.setLinkText
.
Expand
version added: 1.10.0
returns: string
Convert to HTML.
// toHtml (main)
var {firstChild} = Parser.parse('[[category:a]]');
assert.strictEqual(firstChild.toHtml(), '');
对维基文本批量执行语法检查的命令行工具
用于维基文本的 ESLint 插件
A command-line tool that performs linting on Wikitext in bulk
ESLint plugin for Wikitext