summaryrefslogtreecommitdiffstats
path: root/src/Zettel/Math.hs
diff options
context:
space:
mode:
authorYann Herklotz <git@yannherklotz.com>2023-06-09 15:18:28 +0100
committerYann Herklotz <git@yannherklotz.com>2023-06-09 15:18:28 +0100
commit284c6d3abd4cfa1e0eb91961dadffdb04fdc416a (patch)
tree9b11b2f143d70da082c0129bb5e6cba144ad8653 /src/Zettel/Math.hs
parente64342adfca94870769f1e0634e343d43921ab2f (diff)
downloadzk-visual-284c6d3abd4cfa1e0eb91961dadffdb04fdc416a.tar.gz
zk-visual-284c6d3abd4cfa1e0eb91961dadffdb04fdc416a.zip
Use `.` instead of `>>` in fuction compositionmain
Diffstat (limited to 'src/Zettel/Math.hs')
-rw-r--r--src/Zettel/Math.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Zettel/Math.hs b/src/Zettel/Math.hs
index e693e83..49d6420 100644
--- a/src/Zettel/Math.hs
+++ b/src/Zettel/Math.hs
@@ -8,7 +8,7 @@
-- Portability : POSIX
module Zettel.Math where
-import Text.Pandoc.Definition (Inline (..))
+import Text.Pandoc.Definition (Inline (..), Block (..))
import Text.Pandoc.Walk (walk)
import Zettel.Types
@@ -19,5 +19,11 @@ wrapMath = concatMap f
f m@(Math _ _) = [RawInline "markdown" "{{< math >}}", m, RawInline "markdown" "{{< /math >}}"]
f a = [a]
+wrapMathLatex :: Block -> Block
+wrapMathLatex r@(RawBlock t b)
+ | t == "latex" = RawBlock "markdown" $ "{{< math >}}\n" <> b <> "{{< /math >}}"
+ | otherwise = r
+wrapMathLatex r = r
+
wrapZettelGraph :: ZettelGraph -> ZettelGraph
-wrapZettelGraph = walk wrapMath
+wrapZettelGraph = walk wrapMathLatex . walk wrapMath