Module:Qud look: Difference between revisions

Jump to navigation Jump to search
271 bytes added ,  02:21, 29 December 2020
make linebreaks argument actually do things
imported>Teamtotobot
((by SublimeText.Mediawiker))
(make linebreaks argument actually do things)
 
(5 intermediate revisions by 2 users not shown)
Line 2: Line 2:
local colorparse = require'Module:ColorParse'
local colorparse = require'Module:ColorParse'


function p.qudlook(frame, linebreaks)
function p.qudlook(frame)
 
     local args
     local args
local bordercolor
local bordercolor
local padding
local padding
local bottomtext
local bottomtext
local linebreaks = linebreaks or "0"
local linebreaks  


--[determine notxml]--
--[determine notxml]--
Line 16: Line 17:
     notxml = true
     notxml = true
   end
   end
end
if frame.args.linebreaks == "yes" then
linebreaks = true
else
linebreaks = false
end
end


Line 35: Line 41:
--[Determine qud text]--
--[Determine qud text]--
local text = frame.args['text'] or ""
local text = frame.args['text'] or ""
if linebreaks then
text = colorparse.linebreaks(text)
end


--[Determine body padding]--
--[Determine body padding]--
Line 58: Line 67:
local textcontent
local textcontent
local parsedbottomtext
local parsedbottomtext
if linebreaks ~= "0" then
        if colorparse.determinexml(titlein) then
text = colorparse.linebreaks(text)
            title = colorparse.parse('&y'.. titlein, 'xml')
        else
            title = colorparse.parse('&y'..titlein, 'notxml')
        end
if colorparse.determinexml(text) then
        textcontent=colorparse.parse('&y' .. text, 'xml')
else
            textcontent=colorparse.parse('&y' .. text, 'notxml')
end
end
if notxml == true then
  if colorparse.determinexml(bottomtext) then
  title = colorparse.parse('&y'..titlein, 'notxml')
            parsedbottomtext=colorparse.parse('&Y'..bottomtext, 'xml')
  textcontent=colorparse.parse('&y' .. text, 'notxml')
        else
  parsedbottomtext=colorparse.parse('&Y'..bottomtext, 'notxml')
      parsedbottomtext=colorparse.parse('&Y'..bottomtext, 'notxml')
else
  title = colorparse.parse('&y'.. titlein)
  textcontent=colorparse.parse('&y' .. text)
  parsedbottomtext=colorparse.parse('&Y'..bottomtext)
end
end


Navigation menu