Module:Distinguish: Difference between revisions

From FiguraMC
PenguinEncounter (talk | contribs)
m Punctation
mNo edit summary
Line 9: Line 9:
final[#final] = "or " .. final[#final]
final[#final] = "or " .. final[#final]
end
end
return frame:expandTemplate{title = "Hatnote", args = {"Not to be confused with " .. table.concat(final, ", ") .. "."}}
return frame:expandTemplate{title = "Hatnote", args = {"Not to be confused with " .. table.concat(final, (#final <= 2 and " ") or ", ") .. "."}}
end
end


return {["hatnote"] = hatnoteDistinguish}
return {["hatnote"] = hatnoteDistinguish}

Revision as of 01:24, 29 September 2024

  • Not to be confused with .
  • Not to be confused with .
  • Not to be confused with .
  • Not to be confused with .

function hatnoteDistinguish(frame)
	local args = frame.args
	local final = {}
	
	for k, v in ipairs(args) do
		table.insert(final, "[[" .. v .. "]]")
	end
	if #final > 1 then
		final[#final] = "or " .. final[#final]
	end
	return frame:expandTemplate{title = "Hatnote", args = {"Not to be confused with " .. table.concat(final, (#final <= 2 and " ") or ", ") .. "."}}
end

return {["hatnote"] = hatnoteDistinguish}