Content deleted Content added
m perhaps clearer |
in "invalid characters" error, show first subtag with invalid character |
||
Line 358:
local parsed_subtags_mt = {
__index = {
-- "error" is the error message.
-- "index" is the ordinal of the subtag in which the error was found.
throw = function (self, error, index)
self.error = error
Line 420 ⟶ 422:
-- characters and hyphen-minus.
if not tag:find '^[A-Za-z0-9-]+$' then
mw.log(tag, tag:find '[^A-Za-z0-9-]')
return parsed_subtags:throw(
"invalid characters",
fun.indexOf(
function (tag)
return tag:find '[^A-Za-z0-9-]'
end,
potential_subtags))
end
|