Module:Ordnance Survey coordinates/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 296:
 
local function splitref(s)
if s then
local pos = s:find('\127', 1, true)
if pos then
local marker = s:sub(pos, pos)
local parts = mw.text.split(s or '', '\127', true)
local text, references
for k, v in ipairs( parts ) do
if v:match('^[^\127]*UNIQ[^\127]*%-ref[^\127]*$') then
references = (references or '') .. marker .. v .. marker
else
text = (text or '') .. v
end
end
return text,reference
end
return text,reference
end
return s,nil