MultiLineToken - bhsd-harry/wikiparser-node GitHub Wiki
GalleryToken、ImagemapToken 和 ParamTagToken 的父类。这个类继承了 Token 类的全部属性和方法,这里不再列出。
✅ 在 Mini 和 Browser 版本中可用。
🌐 在 Browser 版本中可用。
✅ 展开
type: 'ext-inner'
// type
var token = Parser.parse("<inputbox>type=create</inputbox>")
.firstChild.lastChild;
assert.equal(token, "type=create");
assert.strictEqual(token.type, "ext-inner");🌐 展开
returns: string
以HTML格式输出。
// print (print)
var token = Parser.parse("<inputbox>\ntype=create\nbreak=no</inputbox>")
.firstChild.lastChild;
assert.equal(token, "\ntype=create\nbreak=no");
assert.strictEqual(
token.print(),
`<span class="wpb-ext-inner">
<span class="wpb-param-line"><span class="wpb-param-line-key">type</span>=<span class="wpb-param-line-value">create</span></span>
<span class="wpb-param-line"><span class="wpb-param-line-key">break</span>=<span class="wpb-param-line-value">no</span></span></span>`,
);
token = Parser.parse("<poll>\nQuestion\nChoice 1\nChoice 2\nChoice 3\n</poll>")
.firstChild.lastChild;
assert.equal(token, "\nQuestion\nChoice 1\nChoice 2\nChoice 3\n");
assert.strictEqual(
token.print(),
`<span class="wpb-ext-inner">
<span class="wpb-plain">Question</span>
<span class="wpb-plain">Choice 1</span>
<span class="wpb-plain">Choice 2</span>
<span class="wpb-plain">Choice 3</span>
</span>`,
);