From d161be120c22faf222ec15ca618ee367e4d56575 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 1 Apr 2015 23:16:18 -0700 Subject: Refactor makefile; Add hapax preprocessor --- trunk/forceascii.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 trunk/forceascii.hs (limited to 'trunk/forceascii.hs') diff --git a/trunk/forceascii.hs b/trunk/forceascii.hs new file mode 100644 index 0000000..b5f1645 --- /dev/null +++ b/trunk/forceascii.hs @@ -0,0 +1,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 = ' ' -- cgit 1.4.1-21-gabe81