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

Other Languages

Introduction

List at the start of the line.

All of the following properties and methods are not available in the Mini and Browser versions.

Properties

dd

Expand

type: boolean
Whether it contains :, read-only.

// dd (main)
var {firstChild} = Parser.parse(':');
assert(firstChild.dd);

dt

Expand

type: boolean
Whether it contains ;, read-only.

// dt (main)
var {firstChild} = Parser.parse(';');
assert(firstChild.dt);

ul

Expand

type: boolean
Whether it contains *, read-only.

// ul (main)
var {firstChild} = Parser.parse('*');
assert(firstChild.ul);

ol

Expand

type: boolean
Whether it contains #, read-only.

// ol (main)
var {firstChild} = Parser.parse('#');
assert(firstChild.ol);

Methods

cloneNode

Expand

returns: this
Deep clone the node.

// cloneNode (main)
var {firstChild} = Parser.parse(';');
assert.deepStrictEqual(firstChild.cloneNode(), firstChild);

getRange

Expand

returns: Token
Get the range of the list.

// getRange (main)
var {firstChild} = Parser.parse(';a');
assert.equal(firstChild.getRange(), 'a');
({firstChild} = Parser.parse(';a:b'));
assert.equal(firstChild.getRange(), 'a');
⚠️ **GitHub.com Fallback** ⚠️