-
Notifications
You must be signed in to change notification settings - Fork 3
ExtLinkToken (EN)
Bhsd edited this page May 26, 2026
·
13 revisions
External link wrapped by []. This class mixes the properties and methods of the MagicLinkToken class, and inherits all the properties and methods of the Token class which are not repeated here.
All of the following properties and methods are not available in the Mini and Browser versions.
Expand
type: string
Display text of the external link.
// innerText (main)
var {firstChild, lastChild} = Parser.parse("[//a][//b bb]");
assert.equal(firstChild, "[//a]");
assert.equal(lastChild, "[//b bb]");
assert.strictEqual(firstChild.innerText, "[1]");
assert.strictEqual(lastChild.innerText, "bb");
firstChild.innerText = "a";
assert.equal(firstChild, "[//a a]");Expand
returns: this
Deep clone the node.
// cloneNode (main)
var {firstChild} = Parser.parse("[//a b]");
assert.deepStrictEqual(firstChild.cloneNode(), firstChild);Expand
param: string display text
Set the display text of the external link.
// setLinkText (main)
var {firstChild} = Parser.parse("[//a]");
firstChild.setLinkText("a");
assert.equal(firstChild, "[//a a]");Expand
version added: 1.10.0
returns: string
Convert to HTML.
// toHtml (main)
var root = Parser.parse("[//a][news:b b ]");
root.type = "plain";
assert.strictEqual(
root.toHtml(),
'<a rel="nofollow" class="external autonumber" href="https://a/">[1]</a>'
+ '<a rel="nofollow" class="external text" href="news:b">b </a>',
);
root = Parser.parse("[//a [[b]]c]");
root.type = "plain";
assert.strictEqual(
root.toHtml(),
`<a rel="nofollow" class="external text" href="https://a/"></a><a href="/wiki/B" title="B">b</a>c`,
);对维基文本批量执行语法检查的命令行工具
轻量级的维基模板解析器
维基文本语言服务器协议实现
用于维基文本的 VS Code 扩展
A command-line tool that performs linting on Wikitext in bulk
A lightweight Wikitext template parser
An implementation of the Language Server Protocol for Wikitext
VS Code extension for Wikitext