QuoteToken (EN) - bhsd-harry/wikiparser-node GitHub Wiki
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 {lastChild} = Parser.parse("''''");
assert.equal(lastChild, "'''");
assert.deepStrictEqual(lastChild.lint(), [
{
rule: 'lonely-apos',
severity: 'error',
message: `lonely "'"`,
startLine: 0,
startCol: 0,
startIndex: 0,
endLine: 0,
endCol: 1,
endIndex: 1,
suggestions: [
{
desc: 'escape',
range: [0, 1],
text: ''',
},
],
},
]);
Expand
returns: this
Deep clone the node.
// cloneNode (main)
var {firstChild} = Parser.parse("''");
assert.deepStrictEqual(firstChild.cloneNode(), firstChild);