An API to convert HTML into Luanti Hypertext.
Parse HTML string and return hypertext.
html
: HTML in stringconfig.url_base
: Prefix of links when the FQDN is not found, i.e. it starts with a slash. E.g.https://www.example.com
.config.anchor_base
: Prefix of links when the link is an anchor, i.e. it starts with a hash. E.g.https://www.example.com/page
.
Parse a web page.
http
: Luanti HTTP API. The mod calling it should be put intosecurity.http_mods
and be responsible to retrieve the HTTP API.url
: The website's URL.callback(hypertext)
: Called after the web page is retrieved and the HTML is parsed.hypertext
may benil
on failure.
Parse a MediaWiki page.
http
: Luanti HTTP API. The mod calling it should be put intosecurity.http_mods
and be responsible to retrieve the HTTP API.api
: String, URL to theapi.php
of the MediaWiki installation.page
: String, title of the page to be parsed.callback(hypertext, revid)
: Called after the page is retrieved and the HTML is parsed.hypertext
andrevid
may benil
on failure.