git.iko.soy/typeable/pandoc
on master help sign in
In rendering PandocParsecError, only print input at error location...
4aa84f4John MacFarlane
src/Text/Pandoc/Error.hs+6−1
@@ -90,7 +90,12 @@ handleError (Left e) =
90 ,"\n", replicate (errColumn - 1) ' '
90 ,"\n", replicate (errColumn - 1) ' '
91 ,"^"]
91 ,"^"]
92 else ""
92 else ""
93− in err 65 $ "\nError at " ++ show err' ++ errorInFile
93+ in err 65 $ "\nError at " ++ show err' ++
94+ -- if error comes from a chunk or included file,
95+ -- then we won't get the right text this way:
96+ if sourceName errPos == "source"
97+ then errorInFile
98+ else ""
94 PandocMakePDFError s -> err 65 s
99 PandocMakePDFError s -> err 65 s
95 PandocOptionError s -> err 2 s
100 PandocOptionError s -> err 2 s
96 PandocSyntaxMapError s -> err 67 s
101 PandocSyntaxMapError s -> err 67 s