Module:Section link/sandbox: Difference between revisions

Content deleted Content added
m spaces after commas
mw.ustring.gsub has two return values, a string and number; when both are supplied to mw.title.new, the number will be interpreted as a namespace number, so that for instance mw.title.new(mw.ustring.gsub('<br>test', '%b<>', '')).prefixedText returns Talk:test rather than test
Line 13:
local function normalizeTitle(title)
title = mw.ustring.gsub(mw.ustring.gsub(title, "'", ""), '"', '')
returntitle = mw.title.new(mw.ustring.gsub(title, "%b<>", "")).prefixedText
return mw.title.new(title).prefixedText
end