Index

markdown

MMO.core.markdown · 5 symbols · generated 5 Oct 2026

function

addHtml

markdown.js:9
function MMO.core.markdown.addHtml(root, html, addParagraph = false, join = true)
Namespace
MMO.core.markdown
root
html
addParagraph = false
join = true
constant

SAFE_URL_SCHEMES

markdown.js:23
MMO.core.markdown.SAFE_URL_SCHEMES = ['http', 'https', 'mailto', 'tel'];
Namespace
MMO.core.markdown
function

safeUrl

markdown.js:33

Make an url safe to use as a link/image target.

function MMO.core.markdown.safeUrl(url, base)
Namespace
MMO.core.markdown
A relative url (no scheme, e.g. `path`, `/path`, `//host/path`) is always considered safe. An absolute url is only safe if its scheme is in `MMO.core.markdown.SAFE_URL_SCHEMES` (blocks `javascript:`, `data:`, ...).
urlstring
basestringthe base url. Empty means "resolve against the page showing the markdown"
returnsstring | booleanthe url to link to, or false when it cannot safely be linked
function

headingTag

markdown.js:52

Clamp an heading level to a valid html tag name (h1-h6)

function MMO.core.markdown.headingTag(level)
Namespace
MMO.core.markdown
levelint
returnsstring
function

insert

markdown.js:68
function MMO.core.markdown.insert(root, text, opts = {}, inline = false, addParagraph = true, refs = null)
Namespace
MMO.core.markdown
rootElementthe root element to insert the markdown into
textstringmarkdown
opts = {}Object- {int} headerLevel: header's level (default 1) - {int} tabSpace: tabulation space length (default 2). - {string} baseurl: the base url for relative link - {bool} liveHtml: an ```html block is shown running, next to its source (default true). Turn it off for markdown nobody vetted, such as what an editor is typing: the block is then only text
inline = false
addParagraph = true
refs = null?Objectused internally to carry collected [id]: url "title" reference definitions through recursive calls. Leave it to its default: it is (re)collected once, at the top-level call.
returnsthe root