Jump to content

Module:Unicode chart/sandbox

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Eievie (talk | contribs) at 18:22, 19 April 2024 (Created page with 'local p = {} local getArgs = require('Module:Arguments').getArgs local function cells(startHex, endHex) local startInt = tonumber(startHex, 16) local endInt = tonumber(endHex, 16) local div = mw.html.create("div"):addClass("test") for var=startInt, endInt do div:tag("p"):wikitext('&#x'.. string.format("%x", var) .. ';') end return tostring(div) end function p.main(frameArg) frame = frameArg local args = getArgs(frame) local html = "" if ar...'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

local p = {}
local getArgs = require('Module:Arguments').getArgs

local function cells(startHex, endHex)
	local startInt = tonumber(startHex, 16)
	local endInt = tonumber(endHex, 16)
	
	local div = mw.html.create("div"):addClass("test")
	for var=startInt, endInt do
		div:tag("p"):wikitext('&#x'.. string.format("%x", var) .. ';')
	end
	return tostring(div)
end

function p.main(frameArg)
	frame = frameArg
	local args = getArgs(frame)
	
	local html = ""
	if args['block-range-start'] and args['block-range-end'] then
		html = cells(args['block-range-start'], args['block-range-end'])
	end
	
	return html
end

return p