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

Нет описания правки
Метка: отменено
Нет описания правки
 
(не показано 8 промежуточных версий этого же участника)
Строка 91: Строка 91:
     local lines = mw.text.split(s, "\n")
     local lines = mw.text.split(s, "\n")


    -- Решаем, включать ли обработку числовых списков:
     local enable_numeric = false
     local enable_numeric = false
     for _, line in ipairs(lines) do
     for _, line in ipairs(lines) do
Строка 138: Строка 137:
     return table.concat(out_lines, "\n")
     return table.concat(out_lines, "\n")
end
end


local function transform(s)
local function transform(s)
Строка 153: Строка 150:
             if tip == "" and params._value and visible ~= params._value then tip = params._value end
             if tip == "" and params._value and visible ~= params._value then tip = params._value end
         end
         end
        visible = mw.ustring.gsub(visible, "|", "|")
         return "{{altTooltip|1=" .. (visible or "") .. "|2={{#invoke:Loc|GetRawString|" .. (tip or "") .. "}}}}"
        tip = mw.ustring.gsub(tip, "|", "|")
         return "{{altTooltip|" .. (visible or "") .. "|{{#invoke:Loc|GetString|" .. (tip or "") .. "}}}}"
     end)
     end)
     while true do
     while true do
Строка 203: Строка 198:
     text = process_nowiki_equals(text)
     text = process_nowiki_equals(text)


     return frame:preprocess(transform(text))
     return frame:preprocess('<div class="list-reset-margin">\n' .. transform(text) .. '</div>')
end
end


return p
return p