Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
rv
use if preview
Line 306:
 
local function warning(errmsg)
local framemsg = mw.getCurrentFrame():getParent()errmsg or 'Empty OS grid ref'
local html = ""
local html = require('Module:If preview')._warning({ msg })
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> '..msg
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]]'
Line 362 ⟶ 356:
linktitle = trim(linktitle)
if LL[2] ~= nil then
htmlreturn =linktitle html..warning(LL[2])
local html = linktitle
html = html..warning(LL[2])
return html
end
-- https://geohack.toolforge.org/geohack.php?pagename=Mount_Whitney&params=36.578580925_N_118.29199495_W_type:mountain_region:US-CA_scale:100000_source:NGS