跳转到内容

模組:沙盒/Cookai1205

维基百科,自由的百科全书

这是本页的一个历史版本,由Cookai1205留言 | 贡献2025年1月15日 (三) 19:02编辑。这可能和当前版本存在着巨大的差异。

local p = {}

-- @param frame.args.1 SVG source code.
function p.svgToDataUri( frame )
	local svg = mw.text.trim( frame.args[ 1 ] )
	if svg == '' then
		return ''
	end
	svg = string.gsub( svg, '>%s*<', '><' )
	local out = 'data:image/svg+xml;utf8,' .. mw.uri.encode( svg, 'PATH' )
	return out
end

function p.poj( frame )
	local input = mw.text.trim( frame.args[ 1 ] )
	local wordPattern = '([%a' .. '\204\128' .. '\204\129' .. '\204\130'
		.. '\204\132' .. '\204\134' .. '\204\140' .. '\204\141' .. '\205\152'
		.. ']+)(%d?)'
	local wordList = mw.text.split( input, wordPattern, false )
	return ''
end

return p