diff options
Diffstat (limited to 'filters/icons.lua')
| -rw-r--r-- | filters/icons.lua | 12 | 
1 files changed, 12 insertions, 0 deletions
| diff --git a/filters/icons.lua b/filters/icons.lua new file mode 100644 index 0000000..9e921f3 --- /dev/null +++ b/filters/icons.lua | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | function Str(el) | ||
| 2 | local icon = el.text:match('^:(.*):$') | ||
| 3 | |||
| 4 | if icon then | ||
| 5 | return pandoc.RawInline('html', | ||
| 6 | '<svg class="o-icon o-icon--inline" width="1em" height="1em" aria-hidden="true">\ | ||
| 7 | <use href="/icons.svg#' .. icon .. '"></use>\ | ||
| 8 | </svg>') | ||
| 9 | end | ||
| 10 | |||
| 11 | return el | ||
| 12 | end | ||
