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

Other Languages

Introduction

: which is at the same line with ;. This class inherits all the properties and methods of the Token class which are not repeated here.

🌐 Available in the Browser version.

Properties

indent

type: number
Indentation.

// indent (print)
var {lastChild} = Parser.parse(';;a::');
assert.equal(lastChild, '::');
assert.strictEqual(lastChild.indent, 2);
// indent (main)
var {lastChild} = Parser.parse(';;a::');
lastChild.indent = 1;
assert.equal(lastChild, ':');

Methods

cloneNode

returns: this
Deep clone the node.

// cloneNode (main)
var {lastElementChild} = Parser.parse(';a::');
assert.equal(lastElementChild, ':');
assert.deepStrictEqual(lastElementChild.cloneNode(), lastElementChild);