查看“模块:SectionEmbed”的源代码
来自东方Project线下活动维基
因为以下原因,您没有权限编辑本页:
您可以查看和复制此页面的源代码。
local module = {}
local getArgs = require('Module:Arguments').getArgs
function errorMsg(text)
error(text..'[[分类:含有错误嵌入片段的页面]]')
end
function module._main(args, frame)
local titleName = args['page'] or ''
if titleName == '' then errorMsg('请传入要载入内容所在的页面!') end
local section = args['id'] or ''
section = string.gsub(section, '([%%%(%)%.%+%-%*%?%[%]%^%$])', '%%%1')
local params = args
params['page'] = nil
params['id'] = nil
local title = mw.title.new(titleName)
local redirect = ''
local content = title:getContent()
000
1:0
本页使用的模板: