Module:ColorParse: Difference between revisions
(by SublimeText.Mediawiker)
imported>Teamtotobot ((by SublimeText.Mediawiker)) |
imported>Teamtotobot ((by SublimeText.Mediawiker)) |
||
Line 60: | Line 60: | ||
function p.main(frame) | function p.main(frame) | ||
local | local isnotxml = nil | ||
local unbolded = false | local unbolded = false | ||
local tildes = false | local tildes = false | ||
local text = '' | |||
local args = process_args.merge(true) | local args = process_args.merge(true) | ||
for _, arg in ipairs(args) do | for _, arg in ipairs(args) do | ||
if arg == 'notxml' then | if arg == 'notxml' then | ||
isnotxml = 'notxml' | |||
elseif arg == 'unbolded' then | elseif arg == 'unbolded' then | ||
unbolded = true | unbolded = true | ||
elseif arg == 'tildes are new lines' then | elseif arg == 'tildes are new lines' then | ||
tildes = true | tildes = true | ||
elseif text == '' then | |||
text = arg | |||
end | end | ||
end | end | ||
local returntext = p.parse( | local returntext = p.parse(text, isnotxml) | ||
if tildes == true then | if tildes == true then | ||
returntext = p.linebreaks(returntext) | returntext = p.linebreaks(returntext) |