Module:HSK list

local u = require("Module:string/char")

local export = {}

local function cmn_link(word, script) return ' ' .. word .. ' ' end

local function cmn_tr(word) return ' ' .. word .. ' ' end

local open_paren = ' ( ' local close_paren = ' ) '

function export.link(frame) local text = frame.args[1] or frame:getParent.args[1] -- Matches Latin and doesn't match Han characters; that's all that's needed. local Latin = "[" .. u(0x0061) .. "-" .. u(0x0370) .. "]"	local zh_link = require "Module:zh/link".link text = text:gsub(		'%f[^\n]%* *([^\n]+)',		function (line)			local items = mw.text.split(line, "%s*,%s*")			-- Allow multiple pinyin to be input, separated by commas.			-- Assume that if an item is pinyin, everything after it is pinyin,			-- and that if there is a fourth item, it's pinyin.			if items[4] then				items[3] = table.concat(items, ", ", 3)				items[4] = nil			elseif items[3] and mw.ustring.find(items[2], Latin) then				items[2] = table.concat(items, ", ", 2)				items[3] = nil			end			if items[2] then				line = zh_link(nil, nil, items)			else				mw.log(line)				return ""			end			return "* " .. line		end) return text end

return export