aboutsummaryrefslogtreecommitdiff
path: root/Info/9/3/Planet/pandoc/color-text.lua
blob: 65347659790675f70b3f1a6f62a022715ca73551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- transform to <span style="color: red;"></span>
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