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

мНет описания правки
мНет описания правки
Строка 74: Строка 74:
local function to_nowiki(v)
local function to_nowiki(v)
     local s = tostring(v)
     local s = tostring(v)
    local ok, res = pcall(mw.text.nowiki, s)
     return "<nowiki>".. s .. "</nowiki>"
    if ok and res then
        return res
    end
     return "<no{{subst:ns:0}}wiki>".. s .. "</no{{subst:ns:0}}wiki>"
end
end


Строка 237: Строка 233:


     walk(entry, "")
     walk(entry, "")
   
    if type(frame.preprocess) == "function" then
        return frame:preprocess(table.concat(parts, "|"))
    end


     return table.concat(parts, "|")
     return table.concat(parts, "|")