Module:Unicode chart/sandbox
Appearance
![]() | This is the module sandbox page for Module:Unicode chart (diff). |
![]() | This module is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Modules remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
![]() | This module uses TemplateStyles: |
Implements {{unicode chart}}
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