aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-02-26 15:25:28 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2018-02-26 15:25:28 -0800
commit5ea43630f2d19bd20fd13c38dc23cc3b84c02e3c (patch)
tree9830925c963678963de2d83b9d7d9d9fc49fe996 /src/Text/Pandoc/Readers
parent6ed7926bb4fb5d0ca5d41184bb4dc31925fa3b67 (diff)
downloadpandoc-5ea43630f2d19bd20fd13c38dc23cc3b84c02e3c.tar.gz
LaTeX reader: make --trace work.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index cb70b6403..7ca1cb5a5 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -60,7 +60,7 @@ import Text.Pandoc.BCP47 (Lang (..), renderLang)
import Text.Pandoc.Builder
import Text.Pandoc.Class (PandocMonad, PandocPure, getResourcePath, lookupEnv,
readFileFromDirs, report, setResourcePath,
- setTranslations, translateTerm)
+ setTranslations, translateTerm, trace)
import Text.Pandoc.Error (PandocError (PandocMacroLoop, PandocParseError, PandocParsecError))
import Text.Pandoc.Highlighting (fromListingsLanguage, languagesByExtension)
import Text.Pandoc.ImageSize (numUnit, showFl)
@@ -74,6 +74,7 @@ import Text.Pandoc.Shared
import qualified Text.Pandoc.Translations as Translations
import Text.Pandoc.Walk
import Text.Parsec.Pos
+import qualified Text.Pandoc.Builder as B
-- for debugging:
-- import Text.Pandoc.Extensions (getDefaultExtensions)
@@ -2532,13 +2533,16 @@ addTableCaption = walkM go
block :: PandocMonad m => LP m Blocks
-block = (mempty <$ spaces1)
+block = do
+ res <- (mempty <$ spaces1)
<|> environment
<|> include
<|> macroDef
<|> blockCommand
<|> paragraph
<|> grouped block
+ trace (take 60 $ show $ B.toList res)
+ return res
blocks :: PandocMonad m => LP m Blocks
blocks = mconcat <$> many block