Module:String2: Difference between revisions
From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
Content added Content deleted
(suppress second value from gsub()) |
(function nowiki) |
||
Line 91: | Line 91: | ||
s = string.gsub( s, "%d+", n, 1 ) |
s = string.gsub( s, "%d+", n, 1 ) |
||
return s |
return s |
||
end |
|||
-- nowiki ensures that a string of text is treated by the MediaWiki software as just a string |
|||
-- it takes an unnamed parameter and trims whitespace, then removes any wikicode |
|||
p.nowiki = function(frame) |
|||
local str = mw.text.trim(frame.args[1] or "") |
|||
return mw.text.nowiki(str) |
|||
end |
end |
||