local p = local cfg = mw.loadData("Module:Citation/CS1/Configuration")
local function safe_for_url(str) return str:gsub('[%[%]\n]',);end
local function external_link(URL, label, source, access) local base_url; if not is_set(label) then base_url = URL else local domain, path = URL:match ('^([/%.%-%+:%a%d]+)([/%?#].*)$'); -- split the url into scheme plus domain and path if path then -- if there is a path portion path = path:gsub ('[%[%]]',); -- replace '[' and ']' with their percent encoded values URL = table.concat ; -- and reassemble end
base_url = table.concat; -- assemble a wikimarkup url end if is_set (access) then -- access level (subscription, registration, limited) base_url = substitute (cfg.presentation['ext-link-access-signal'],); -- add the appropriate icon end return base_url;end