Jump to content

Module:Convert/show

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Johnuniq (talk | contribs) at 07:44, 28 October 2013 (strip more). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

-- Stripped down to show frame:preprocess() weirdness.

local function show_example(frame)
    for i, item in ipairs(frame.args) do
        item = item:gsub('!', '|')
        item = '{{convert/sandboxlua' .. (item:sub(1, 1) == '|' and '' or '|') .. item .. '}}'
        local a = mw.text.nowiki(item)
        local b = frame:preprocess(item)
        local c = '[' .. a .. '] --> "' .. b .. '"'
        mw.log(c)
        return c .. '\n'
    end
    return 'NOTHING'
end

return { show_example = show_example }