Difference between revisions of "Module:String"
Jump to navigation
Jump to search
replace_plain fix
>WOSlinker (add str.replace_plain) |
>WOSlinker (replace_plain fix) |
||
Line 175: | Line 175: | ||
local pattern_plain = mw.ustring.gsub(pattern, '%%', '%%%%'); | local pattern_plain = mw.ustring.gsub(pattern, '%%', '%%%%'); | ||
local replace_plain = mw.ustring.gsub(replace, '%%', '%%%%'); | local replace_plain = mw.ustring.gsub(replace, '%%', '%%%%'); | ||
local result; | |||
if firstonly == 'true' or firstonly == 'yes' or firstonly == '1' then | if firstonly == 'true' or firstonly == 'yes' or firstonly == '1' then | ||
result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, 1 ); | |||
else | else | ||
result = mw.ustring.gsub( source_str, pattern_plain, replace_plain, n ); | |||
end | end | ||