Module:links: Difference between revisions

m 1 revision imported
Undo revision 523165 by Sware (talk)
Tag: Undo
 
(3 intermediate revisions by the same user not shown)
Line 321: Line 321:


if target:sub(1, 1) == ":" then
if target:sub(1, 1) == ":" then
-- FIXME, the auto_display (second return value) should probably remove the colon
local link_target = target:sub(2)
return target:sub(2), orig_target
link_target = (lang:hasType("conlang") and "Contionary:" or "wikt:") .. link_target
return link_target, orig_target
end
end


Line 455: Line 456:
-- If `no_alt_ast` is true, use pcall to catch the error which will be thrown if this is a reconstructed lang and the alt text doesn't have *.
-- If `no_alt_ast` is true, use pcall to catch the error which will be thrown if this is a reconstructed lang and the alt text doesn't have *.
if link.display == auto_display then
if link.display == auto_display then
insert(cats, lang:getFullName() .. " links with redundant alt parameters")
else
else
local ok, check
local ok, check
Line 463: Line 463:
ok = true
ok = true
check = export.get_link_page(orig_display, lang, sc, plain)
check = export.get_link_page(orig_display, lang, sc, plain)
end
if ok and link.target == check then
insert(cats, lang:getFullName() .. " links with redundant target parameters")
end
end
end
end