summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Error.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index 2bd8bef0a..a05cdfe43 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -90,7 +90,12 @@ handleError (Left e) =
,"\n", replicate (errColumn - 1) ' '
,"^"]
else ""
- in err 65 $ "\nError at " ++ show err' ++ errorInFile
+ in err 65 $ "\nError at " ++ show err' ++
+ -- if error comes from a chunk or included file,
+ -- then we won't get the right text this way:
+ if sourceName errPos == "source"
+ then errorInFile
+ else ""
PandocMakePDFError s -> err 65 s
PandocOptionError s -> err 2 s
PandocSyntaxMapError s -> err 67 s