summaryrefslogtreecommitdiffstats
path: root/filters/icons.lua
blob: 36d2108fe31c4ed15efddf172fc5889fe6ac2acf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
function Str(el)
    local icon = el.text:match('^:(.*):$')

    if icon then
        return pandoc.RawInline('html',
            '<svg class="o-icon o-icon--inline" width="1em" height="1em" aria-hidden="true">\
                <use href="$assets.icons_svg$#' .. icon .. '"></use>\
            </svg>')
    end

    return el
end