NowikiBaseToken (EN) - bhsd-harry/wikiparser-node GitHub Wiki
The parent class of CommentToken, DoubleUnderscoreToken, HrToken, ListBaseToken, NoincludeToken, QuoteToken and the rest. This class inherits all the properties and methods of the Token class which are not repeated here.
✅ Available in the Mini and Browser versions.
✅ Expand
type: string
Text content.
// innerText
var {firstChild} = Parser.parse('<!-- a -->');
assert.equal(firstChild, '<!-- a -->');
assert.strictEqual(firstChild.innerText, ' a ');
Expand
param: this
Deep clone the node.
// cloneNode (main)
var {firstChild: {lastChild}} = Parser.parse('<nowiki>a</nowiki>');
assert.equal(lastChild, 'a');
assert.deepStrictEqual(lastChild.cloneNode(), lastChild);