跳转到内容

模組:Based on

被永久保护的模块
维基百科,自由的百科全书

这是本页的一个历史版本,由Dabao qian留言 | 贡献2017年8月1日 (二) 09:14 (// Edit via Wikiplus)编辑。这可能和当前版本存在着巨大的差异。

local p = {}

function p.lua_main(frame)
	local s = frame.args[1]
	
	if frame.args[3] then
		local args = {}
		
		for i, v in ipairs(frame.args) do
			if i >= 2 then
				args[#args+1] = v
			end
		end
		
		args['style'] = 'display: inline'
		args['list_style'] = 'display: inline'
		args['item1_style'] = 'display: inline'

		sep = mw.message.new( 'comma-separator' ):plain()
		
		h = mw.html.create('div')
		h:wikitext('《' .. s .. '》')
		h:tag('br')  -- h:newline() is not working for some reason
		h:wikitext('作者')
		h:wikitext(frame:expandTemplate{ title = 'Unbulleted list', args = args })
		
		return h
	elseif frame.args[2] then
		s = '《' .. s .. '》' .. '<br />' .. frame.args[2] .. '作品'
		return s
	end
	
	return s
end

function p.main(frame)
	return p.lua_main(frame:getParent())
end

return p