From 3ef74d1fd2fa7937da841f90d3ff3d8dc87488c8 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 4 Feb 2024 22:37:37 -0800 Subject: Typst reader: fix handling of `dot()`, `tilde()`, `ddot()`. See jgm/typst-hs#38. --- src/Text/Pandoc/Readers/Typst/Math.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Readers/Typst/Math.hs b/src/Text/Pandoc/Readers/Typst/Math.hs index e06e1c680..7d61d893c 100644 --- a/src/Text/Pandoc/Readers/Typst/Math.hs +++ b/src/Text/Pandoc/Readers/Typst/Math.hs @@ -31,8 +31,6 @@ import Text.Pandoc.Readers.Typst.Parsing ( P, pTok, ignored, pWithContents, getField, chunks ) import Typst.Types --- import Debug.Trace - withGroup :: [Exp] -> Exp withGroup [x] = x withGroup xs = EGrouped xs @@ -91,6 +89,9 @@ handleMath tok = base <- getField "base" fields >>= pMathGrouped acc <- getField "accent" fields >>= pMathGrouped let acc' = case acc of + ESymbol _ "\8901" -> ESymbol Accent "\775" -- \dot + ESymbol _ "\168" -> ESymbol Accent "\776" -- \ddot + ESymbol _ "\8764" -> ESymbol Accent "\771" -- \tilde ESymbol _ t -> ESymbol Accent t _ -> acc pure $ EOver False base acc' -- cgit v1.2.3