Content deleted Content added
add support for display= option |
update display title checking |
||
Line 9:
page = page or ''
return string.format('[[%s#%s|%s]]', page, section, display)
end
local function normalizeTitle(title)
title = mw.ustring.gsub(title.lower,"_"," ")
title = mw.ustring.gsub(title,"'","")
title = mw.ustring.gsub(title,"%b<>","")
title = mw.ustring.gsub(title,"^:","")
title = mw.ustring.gsub(title,":([^%s])",": %1",1)
return title
end
Line 44 ⟶ 53:
page = page or title.prefixedText
if displaytitle then
if
display = displaytitle .. ' ' .. display
else
error(
'Warning: Display title "%s" was ignored since it ' ..
"is not equivalent to the page's actual title.",
displaytitle
), 2)
end
else
|