Skip to content

Instantly share code, notes, and snippets.

@tim6her
Last active May 19, 2018 11:58
Show Gist options
  • Save tim6her/58161040439fb510ca2f4e3a9ee795fb to your computer and use it in GitHub Desktop.
Save tim6her/58161040439fb510ca2f4e3a9ee795fb to your computer and use it in GitHub Desktop.
A simple Pandoc filter, that ignores math environments
#!/usr/bin/env runhaskell
-- keep-math.hs
-- (c) 2018, Tim Herbstrith
import Text.Pandoc.JSON
main :: IO ()
main = toJSONFilter ignoreMath
ignoreMath :: Inline -> Inline
ignoreMath (Math InlineMath y) = Str $ "$" ++ y ++ "$"
ignoreMath (Math DisplayMath y) = Str $ "$$" ++ y ++ "$$"
ignoreMath x = x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment