Module:string/replacementEscape

From Linguifex
Revision as of 01:43, 25 May 2025 by wikt>Theknightwho
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Documentation for this module may be created at Module:string/replacementEscape/doc

local gsub = string.gsub

--[==[Escapes {%}, which is the only magic character used in replacement strings, which are given as the third argument to {string.gsub} and {mw.ustring.gsub}, as well as format strings given to {string.format} and {mw.ustring.format}.]==]
return function(str)
	return (gsub(str, "%%", "%%%%"))
end