Module:Links

local m = {}

function m.wikilink(title, text) if title:inNamespace('Category') then -- Link to the category page instead of categorizing. -- To categorize, use utils.categorize. return "" .. mw.text.nowiki(text) .. "" else return "" .. mw.text.nowiki(text) .. "" end end

function m.external_link(uri, text) return "[" .. tostring(uri) .. " " .. mw.text.nowiki(text) .. "]" end

-- This function wraps the link in a span with class plainlinks. -- See https://www.mediawiki.org/wiki/Manual:Plainlinks for more information. function m.plain_external_link(...) return tostring(mw.html.create('span')			:addClass('plainlinks')			:wikitext(m.external_link(...))		) end

return m