-
Notifications
You must be signed in to change notification settings - Fork 2
debug
Bhsd edited this page Nov 21, 2024
·
3 revisions
This is an internal document. For visitors, you can now go back to the home page.
// debug (main)
var {firstChild: {firstChild}} = Parser.parse('[[file:a]]'),
token, cloned;
assert.equal(firstChild.type, 'link-target');
try {
firstChild.setText('a');
} catch {}
assert.equal(String(firstChild), 'file:a');
token = Parser.parse('{{{!}}').firstChild;
({firstChild} = token);
assert.equal(firstChild.type, 'table-syntax');
try {
firstChild.length = 1;
} catch {}
assert.equal(firstChild, '{{{!}}');
firstChild.replaceChildren('{|');
assert.equal(firstChild, '{|');
token = Parser.parse('<gallery>a</gallery>').querySelector('link-target');
try {
token.append('<');
} catch {}
assert.equal(token, 'a');
token = Parser.parse('-{zh-cn:a}-')
.querySelector('converter-rule');
({firstChild} = token);
assert.equal(firstChild.type, 'converter-rule-variant');
cloned = firstChild.cloneNode();
cloned.setText('!');
try {
firstChild.safeReplaceWith(cloned);
} catch {}
assert.equal(token, 'zh-cn:a');
对维基文本批量执行语法检查的命令行工具
用于维基文本的 ESLint 插件
A command-line tool that performs linting on Wikitext in bulk
ESLint plugin for Wikitext