Module:Unicode chart/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 6:
local function isReserved(hex)
return unicodeLookupName(tonumber(hex, 16)):find("<reserved")
end
 
local function unicodeChar(hex)
if isReserved(hex) then
return mw.html.create("div")
:addClass("reserved")
else
return mw.html.create("div")
:wikitext('&#x'.. hex .. ';')
end
-- return frame:expandTemplate{
-- title = 'unichar',
-- args = {hex}
-- }
-- return '&#x'.. hex .. ';'
-- .. '<br>' .. lookup({'name', hex})
end
 
Line 45 ⟶ 29:
local cell = row:tag("td")
if isReserved(hexStr) then
cell:addClasstitle("reservedReserved")
:addClass("reserved")
:cssText("background-color:#CCCCCC;")
else
cell:wikitext('&#x'.. hexStr .. ';')