Модуль:Loc/Marking: различия между версиями

мНет описания правки
мНет описания правки
Строка 75: Строка 75:
local function convert_lists(s)
local function convert_lists(s)
     if not s or s == "" then return s end
     if not s or s == "" then return s end
    local lines = mw.text.split(s, "\n")
     local first_non_empty = nil
     local first_non_empty = nil
     for line in mw.ustring.gmatch(s, "([^]*)?") do
     for i, line in ipairs(lines) do
         if line and line:match("%S") then
         if line and line:match("%S") then
             first_non_empty = line
             first_non_empty = line
Строка 87: Строка 88:
     end
     end
     local out_lines = {}
     local out_lines = {}
     for line in mw.ustring.gmatch(s, "([^]*)?") do
     for _, line in ipairs(lines) do
         local processed = line
         local processed = line
         local handled = false
         local handled = false
Строка 116: Строка 117:
         end
         end
     end
     end
     return table.concat(out_lines, "")
     return table.concat(out_lines, "\n")
end
end