Content deleted Content added
in "invalid characters" error, show first subtag with invalid character |
m consistency, rm logging |
||
Line 1:
local p = {}
local Unicode_data = require
local function errorf(level, ...)
Line 36:
local Latn_pattern = table.concat {
};
Line 134:
function p.show(frame)
local expanded_pattern = Latn_pattern
:gsub(
:gsub( -- Find two UTF-8-encoded characters separated by hyphen-minus.
function (char1, char2)
return expand_range(char1, char2)
Line 143:
return ('* <div style="overflow-wrap: break-word;">%s</div><br>%s')
:format(expanded_pattern
:gsub(
show_scripts(mw.ustring.gcodepoint(expanded_pattern)))
end
Line 173:
local function link_block_name(block_name)
if block_name:find
return ("[[%s]]"):format(block_name)
else
Line 213:
or codepoint <= 0x1F)) then
if self[script_code].n == 0x20 then
local period = (
for _ = 1, 3 do
self[script_code].n = self[script_code].n + 1
Line 340:
local language_codes = {}
for lang_template in content:gmatch
local template_name = lang_template:match(
local language_code
if template_name ==
language_code = lang_template:match
elseif template_name:find
language_code = lang_template:match
end
if language_code then
Line 353:
end
return table.concat(m_table.keysToList(language_codes),
end
Line 421:
-- Language tags probably only contain ASCII alphabetic and numerical
-- characters and hyphen-minus.
if not tag:find
return parsed_subtags:throw(
"invalid characters",
fun.indexOf(
function (tag)
return tag:find
end,
potential_subtags))
|