Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
simplify error message
don't track empty OS grid ref usage
Line 304:
local frame = mw.getCurrentFrame():getParent()
local html = ""
local msg = errmsg
if errmsg == nil then
msg = "Empty OS grid ref"
end
if frame:preprocess( "{{REVISIONID}}" ) == "" then
html = '<div style="color:red"><strong>Warning:</strong> '..errmsgmsg
html = html..' <small>(this message is shown only in preview)</small></div>'
end
if namespace == 0 and errmsg ~= nil then
html = html..'[[Category:Pages with malformed OS coordinates]]'
end
Line 318 ⟶ 322:
local input = args[1]
if input == nil or string.len(input)==0 then
return warning("Empty OS grid ref"nil)
end
local linktitle = args[2]