Module:Invert italics: Difference between revisions
From Sanarchive
More languages
More actions
Created page with "local p = {} function p.main(frame) local text = frame.args[1] or "" local result = text local count = 0 while result:find("''") do if count % 2 == 0 then result = result:gsub("''", '<span style="font-style:normal;">', 1) else result = result:gsub("''", '</span>', 1) end count = count + 1 end return result end return p" |
m Protected "Module:Invert italics": Excessive vandalism ([Edit=Allow only administrators] (indefinite) [Move=Allow only administrators] (indefinite)) |
(No difference)
| |
Latest revision as of 23:31, 27 January 2026
Documentation for this module may be created at Module:Invert italics/doc
local p = {}
function p.main(frame)
local text = frame.args[1] or ""
local result = text
local count = 0
while result:find("''") do
if count % 2 == 0 then
result = result:gsub("''", '<span style="font-style:normal;">', 1)
else
result = result:gsub("''", '</span>', 1)
end
count = count + 1
end
return result
end
return p