summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2024-03-09 08:59:46 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2024-03-09 12:53:13 -0800
commit626ffd74b4cb0038eb7d4ee638486f156753da1c (patch)
tree3d62f17a99f00c7bb0a73b0201f146ac63e7545d /src/Text/Pandoc
parenteca9ad1009127ac4f4a0c9e21dd45562d676aae2 (diff)
LaTeX reader: Make `withRaw` work inside `parseFromToks`.
This is needed for raw environments to work inside table cells. Closes #9517.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX/Parsing.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
index c2217f809..388c6fa09 100644
--- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
+++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs
@@ -490,7 +490,11 @@ parseFromToks parser toks = do
case toks of
Tok pos _ _ : _ -> setPosition pos
_ -> return ()
- result <- disablingWithRaw parser
+ -- we ignore existing raw tokens maps (see #9517)
+ oldRawTokens <- sRawTokens <$> getState
+ updateState $ \st -> st{ sRawTokens = mempty }
+ result <- parser
+ updateState $ \st -> st{ sRawTokens = oldRawTokens }
setInput oldInput
setPosition oldpos
return result