about summary refs log tree commit diff stats
path: root/scripts/forceascii.hs
blob: b5f1645ac0aa068c51ec5e34ba924aa7fe589081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-- Preprocessor for hapax.lua writer
-- because for some damn reason, UTF-8 confuses things

import Text.Pandoc.JSON
import Data.Char (isAscii)

main :: IO ()
main = toJSONFilter unFancy

unFancy :: Inline -> Inline
unFancy (Str s) = Str $ map makeAscii s
unFancy x       = x

makeAscii :: Char -> Char
makeAscii c
    | isAscii c = c
    | otherwise = ' '