DdToken - bhsd-harry/wikiparser-node GitHub Wiki

Other Languages

简介

;位于同一行的:。这个类继承了 Token 类的全部属性和方法,这里不再列出。

🌐 在 Browser 版本中可用。

Properties

indent

type: number
缩进数。

// 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
深拷贝节点。

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