Content deleted Content added
No edit summary |
No edit summary |
||
(20 intermediate revisions by the same user not shown) | |||
Line 28:
}
local
-- Block: Variation Selectors
{first = 0xFE00, last = 0xFE0F, str = "VS<br>", startNum = 1},
Line 95:
local function getCategory(codepoint)
local category = mUnicode.lookup_control(codepoint.int)
if category ~= "unassigned" then
Line 125 ⟶ 122:
---------------------
local function getCellAbbr(codepoint, category, args)
local function
for key, value in pairs(
if codepoint.int >= value.first
and codepoint.int <= value.last then
return value.str .. (codepoint.int - value.first + value.startNum)
end
end
end
function getAliasAbbr(codepoint)▼
local tbl = getAliasValues(codepoint.int, "abbreviation")▼
--for key, value in pairs(specialFormatSets) do
-- if codepoint.int >= value.first
Line 143 ⟶ 138:
-- end
--end
▲ return alias
▲ local function getAliasAbbr(codepoint)
▲ local tbl = getAliasValues(codepoint.int, "abbreviation")
return tbl[1] or nil
end
local function abbrFromString(codepoint, args)
local abbr = ""
local name = mUnicode.lookup_name(codepoint.int)
Line 161 ⟶ 159:
end
--exception listed at top
local
if
--abbr on list
local
if
--make own abbr
if category == "control" or category == "format" then
Line 181 ⟶ 179:
end
return aliasStr
local function linkChar(unicodeChar, codepoint, args)
elseif args['link'] == "wikt" then
end
end
Line 190 ⟶ 201:
end
local function abbrCell(abbr)
cell:addClass("abbr-
cell:tag("div"):addClass("abbr-box"):wikitext(abbr)
end
Line 205 ⟶ 216:
else
local unicodeChar = '&#x'.. codepoint.hex .. ';'
unicodeChar = linkChar(unicodeChar, codepoint, args) or unicodeChar
▲ if (args['link_sub'] and args['link_sub'][codepoint.int]) then
cell:addClass("modified")▼
▲ local redir = mRedirect.luaMain(unicodeChar, false)
▲ --unicodeChar = '[[' .. redir .. '|' .. unicodeChar .. ']]'
▲ unicodeChar = expandTemplate('Link if exists', {unicodeChar})
▲ elseif args['link'] == "wikt" then
▲ unicodeChar = '[[wikt:' .. unicodeChar .. '|' .. unicodeChar .. ']]'
end
if args['wrapper'] then
Line 219 ⟶ 226:
elseif args['font'] then
cell:css("font-family", "'" .. args['font'] .. "'")
--unicodeChar = tostring(
▲ end
-- mw.html.create("div")
-- :css("font-family", "'" .. args['font'] .. "'")
▲ unicodeChar = unicodeChar
-- :wikitext(unicodeChar)
▲ .. '&#x' .. args['suffix'][codepoint.int] .. ';'
--)
▲ cell:addClass("modified")
end
cell:wikitext(unicodeChar)
Line 256 ⟶ 263:
local row = body:tag("tr")
row:tag("th"):wikitext("U+".. rowHex .. "<i>x</i>")
:attr("rowspan", "2")
for colIndex=0, 15 do
local cell = row:tag("td")
--rowHex .. string.format("%X", colIndex)
createCell(cell,
newCodepoint(
args
)
end
local subrow = body:tag("tr")
for colIndex=0, 15 do
subrow:tag("td"):addClass("codepoint")
:wikitext(string.format("%04X", rowIndex*16 + colIndex))
end
end
Line 343 ⟶ 357:
end
end
-- look up block by na,e
if args['blockname'] then
local range = mUnicode.get_block_info(args['blockname'])
Line 353 ⟶ 369:
args
)
-- block given as start and end of range
elseif args['rangestart'] and args['rangeend'] then
return createTable(
|