-- transform to if FORMAT:match 'html' then function Span(el) color = el.attributes['color'] -- if no color attribute, return unchange if color == nil then return el end -- remove color attributes el.attributes['color'] = nil -- use style attribute instead el.attributes['style'] = 'color: ' .. color .. ';' -- return full span element return el end end