跳转到内容

模块:沙盒/a2569875/DemoBUG

维基百科,自由的百科全书
local p={}
local lib_arg={};
local lib_para = {}
function p.delnowiki(frame)
	local args, working_frame
    if frame == mw.getCurrentFrame() then
        -- We're being called via #invoke. The args are passed through to the module
        -- from the template page, so use the args that were passed into the template.
        if lib_arg.getArgs == nil then lib_arg = require('Module:Arguments') end
        args = lib_arg.getArgs(frame, {parentFirst=true})
        working_frame = frame
    else
        -- We're being called from another module or from the debug console, so assume
        -- the args are passed in directly.
        args = frame
        working_frame = mw.getCurrentFrame()
        if type(args) ~= type({}) then args = {frame} end
    end
    local input_n = args[1] or args['1']
	local input_data = "" .. mw.text.unstripNoWiki( input_n )
	return working_frame:preprocess( input_data )
end

function p.unnowikiWithStringSub(frame)
	local args, working_frame
    if frame == mw.getCurrentFrame() then
        -- We're being called via #invoke. The args are passed through to the module
        -- from the template page, so use the args that were passed into the template.
        if lib_arg.getArgs == nil then lib_arg = require('Module:Arguments') end
        args = lib_arg.getArgs(frame, {parentFirst=true})
        working_frame = frame
    else
        -- We're being called from another module or from the debug console, so assume
        -- the args are passed in directly.
        args = frame
        working_frame = mw.getCurrentFrame()
        if type(args) ~= type({}) then args = {frame} end
    end
    local input_n = args[1] or args['1']
	local input_data = "" .. mw.text.unstripNoWiki( input_n )
	return working_frame:preprocess( mw.ustring.sub( input_data, 2,-2 ) )
end
return p;