Module:links: Difference between revisions
No edit summary |
Tag: Undo |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 321: | Line 321: | ||
if target:sub(1, 1) == ":" then | if target:sub(1, 1) == ":" then | ||
local link_target = target:sub(2) | |||
link_target = (lang:hasType("conlang") and "Contionary:" or "wikt:") .. link_target | |||
return link_target, orig_target | |||
end | end | ||
| Line 356: | Line 357: | ||
end | end | ||
end | end | ||
target, escaped = target:gsub("^(\\-)\\%*", "%1*") | target, escaped = target:gsub("^(\\-)\\%%*", "%1*") | ||
if reconstructed == 0 and lang:hasType("reconstructed | if reconstructed == 0 and lang:hasType("reconstructed") then | ||
orig_target = "*" .. target | orig_target = "*" .. target | ||
reconstructed = 1 | reconstructed = 1 | ||
| Line 400: | Line 401: | ||
--.. " is unattested, while the given term does not begin with '*' to indicate that it is reconstructed.") | --.. " is unattested, while the given term does not begin with '*' to indicate that it is reconstructed.") | ||
orig_target = "*" .. target | orig_target = "*" .. target | ||
end | |||
else | |||
if reconstructed == 1 then | |||
target = "*" .. target | |||
end | end | ||
end | end | ||
| Line 451: | 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 | ||
else | else | ||
local ok, check | local ok, check | ||
| Line 459: | 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 | end | ||
end | end | ||