Content deleted Content added
Minor cleanup |
preference for date over full link |
||
Line 85:
local function createLink(label, suffix)
-- if label is a valid link or not▼
local prefix = "Solar eclipse of "
if mw.ustring.match(label, "^%[%[.*%]%]$") then▼
-- check if label starts with the prefix
return label▼
if mw.ustring.find(label, "^" .. prefix) then
end▼
-- extract the date part from the label
local page = label -- this is the full page title to link to
if ifexist(link) then▼
return string.format('[[%s|%s]]', link, label)▼
else▼
return label▼
else
-- if page doesn't exist, display the date
return dateLabel
end
else
-- for labels without the prefix, display as plain text
end
end
|