Module:Section link/sandbox: Difference between revisions

Content deleted Content added
fix wrong variable name, again
simplify
Line 12:
 
local function normalizeTitle(title)
title = mw.ustring.gsub(mw.ustring.gsub(title,"'",""),'"','')
title =return mw.title.new(mw.ustring.gsub(title,'"'%b<>",''"")).prefixedText
title = mw.ustring.gsub(title,"%b<>","")
return mw.title.new(title).prefixedText
end
 
Line 127 ⟶ 125:
if page then
local p, s = page:match('^(.-)#(.*)$')
if p then page, sections[1] = p, s end
page = p
sections[1] = s
end
end