跳转到内容

模組:Chembox CASNo

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

这是本页的一个历史版本,由A2569875留言 | 贡献2020年10月29日 (四) 13:41编辑。这可能和当前版本存在着巨大的差异。

local p,lib_arg ={},{}
function p._print_chembox(frame)
-- For calling from #invoke.
    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) --frame.args
    else
        -- We're being called from another module or from the debug console, so assume
        -- the args are passed in directly.
        args = frame
    end
    working_frame = mw.getCurrentFrame()
	local chembox_str = working_frame:preprocess('{{Chembox CASNo}}')
	local start=mw.ustring.find(chembox_str, '|', 1+({mw.ustring.find(chembox_str, '\n')})[1] )
	local chembox_start, chembox_end = mw.ustring.sub(chembox_str,1,start), mw.ustring.sub(chembox_str,start+1,-1)
	local count = 0
	mw.log(args)
    --return 
	return ''
	
end
return p