-
Notifications
You must be signed in to change notification settings - Fork 2
QuoteToken (EN)
Bhsd edited this page Dec 6, 2024
·
10 revisions
Single quotes (italic or bold).
✅ Available in the Mini and Browser versions.
✅ Expand
version added:1.3.9
type: boolean
Whether it is bold.
// bold
var {firstChild} = Parser.parse("'''");
assert(firstChild.bold);
✅ Expand
version added:1.3.9
type: boolean
Whether it is italic.
// italic
var {firstChild} = Parser.parse("''");
assert(firstChild.italic);
✅ Expand
returns: LintError[]
Report potential grammar errors.
// lint
var {firstChild: {firstChild: {lastChild}}} = Parser.parse("==''''==");
assert.equal(lastChild, "'''");
assert.deepStrictEqual(lastChild.lint(), [
{
rule: 'lonely-apos',
severity: 'error',
message: `lonely "'"`,
startLine: 0,
startCol: 2,
startIndex: 2,
endLine: 0,
endCol: 3,
endIndex: 3,
suggestions: [
{
desc: 'escape',
range: [2, 3],
text: ''',
},
{
desc: 'remove',
range: [2, 3],
text: '',
},
],
},
{
rule: 'bold-header',
severity: 'warning',
message: 'bold in section header',
startLine: 0,
startCol: 3,
startIndex: 3,
endLine: 0,
endCol: 6,
endIndex: 6,
suggestions: [
{
desc: 'remove',
range: [3, 6],
text: '',
},
],
},
]);
Expand
returns: this
Deep clone the node.
// cloneNode (main)
var {firstChild} = Parser.parse("''");
assert.deepStrictEqual(firstChild.cloneNode(), firstChild);
对维基文本批量执行语法检查的命令行工具
用于维基文本的 ESLint 插件
A command-line tool that performs linting on Wikitext in bulk
ESLint plugin for Wikitext