NowikiBaseToken (EN) - bhsd-harry/wikiparser-node GitHub Wiki

Other Languages

Introduction

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.

Properties

innerText

✅ Expand

type: string
Text content.

// innerText
var {firstChild} = Parser.parse('<!-- a -->');
assert.equal(firstChild, '<!-- a -->');
assert.strictEqual(firstChild.innerText, ' a ');

Methods

cloneNode

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);
⚠️ **GitHub.com Fallback** ⚠️