Module:Adjacent stations/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 811:
local remove_rows = {}
local data = {}
local noclear = false
for i, v in ipairs(code) do
code[i] = mw.ustring.gsub(code[i], '\n', ' ')
local template = mw.ustring.lower(mw.text.trim(mw.ustring.match(code[i], '^[^|]+')))
code[i] = mw.ustring.match(code[i], '(|.+)$')
if (mw.ustring.match(code[i], 'noclear%s*=%s*[a-z]')) then
noclear = true
end
if template == 's-line' then
data[i] = {}
Line 897 ⟶ 901:
end
code = table.concat(code, '\n')
local t = {'{{Adjacent stations' .. (noclear and '|noclear=y' or ''), '\n}}'}
system = mw.ustring.match(code, '|system(%d*)=')
code = mw.ustring.gsub(code, '\n\n+', '\n')