Module:Unicode chart/sandbox: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 135:
end
local function getAliasAbbr(codepoint)
local tbl = getAliasValues(codepoint.int, "abbreviation")
local alias = tbl[1] or nil -- last one
--for key, value in pairs(specialFormatSets) do
-- if codepoint.int >= value.first
Line 144 ⟶ 141:
-- end
--end
local function getAliasAbbr(codepoint)
local tbl = getAliasValues(codepoint.int, "abbreviation")
local alias = tbl[1] or nil -- last one
return alias
end
Line 182 ⟶ 183:
end
return aliasStr
end
 
local function linkChar(unicodeChar, codepoint, args)
if (args['link_sub'] and args['link_sub'][codepoint.int]) then
return '[[' .. args['link_sub'][codepoint.int]
.. '|' .. unicodeChar .. ']]'
elseif args['link'] == "wiki" then
local redir = mRedirect.luaMain(unicodeChar, false)
-- '[[' .. redir .. '|' .. unicodeChar .. ']]'
return expandTemplate('Link if exists', {unicodeChar})
elseif args['link'] == "wikt" then
return '[[wikt:' .. unicodeChar .. '|' .. unicodeChar .. ']]'
end
end
 
Line 206 ⟶ 220:
else
local unicodeChar = '&#x'.. codepoint.hex .. ';'
unicodeChar = linkChar(unicodeChar, codepoint, args) or unicodeChar
if (args['link_sub'] and args['link_sub'][codepoint.int]) then
-- unicodeCharif = '[(args['link_sub'] ..and args['link_sub'][codepoint.int]) then
-- ..unicodeChar = '|[[' .. unicodeChar .. args['link_sub'][codepoint.int]'
-- .. '|' .. unicodeChar .. ']]'
elseif args['link'] == "wiki" then
-- elseif args['link'] == "wiki" then
local redir = mRedirect.luaMain(unicodeChar, false)
-- --unicodeChar = '[[' ..local redir .. '|'= mRedirect.. luaMain(unicodeChar, .. ']]'false)
-- --unicodeChar = expandTemplate('Link[[' if.. redir .. exists',|' .. {unicodeChar}) .. ']]'
-- unicodeChar = expandTemplate('Link if exists', {unicodeChar})
elseif args['link'] == "wikt" then
-- elseif args['link'] == "wikt" then
-- unicodeChar = '[[wikt:' .. unicodeChar .. '|' .. unicodeChar .. ']]'
-- end
if args['wrapper'] then
unicodeChar = expandTemplate(args['wrapper'], {unicodeChar})