aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2016-10-31 22:04:22 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2016-10-31 22:04:22 +0100
commit5d02e478d0524cee52991740ffdf0ee87296b5d4 (patch)
treefc536f04379ad02c400fccb358fefe40040b9d45 /src/Text
parent4f06e6c4455b5b6be21416e9736a70f8d2b1ff1c (diff)
downloadpandoc-5d02e478d0524cee52991740ffdf0ee87296b5d4.tar.gz
LaTeX reader: allow for []s inside LaTeX optional args.
Fixes cases like: \begin{center} \begin{tikzpicture}[baseline={([yshift=+-.5ex]current bounding box.center)}, level distance=24pt] \Tree [.{S} [.NP John\index{i} ] [.VP [.V likes ] [.NP himself\index{i,*j} ]]] \end{tikzpicture} \end{center}
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/LaTeX.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX.hs b/src/Text/Pandoc/Readers/LaTeX.hs
index cb6b183f9..d35bf5182 100644
--- a/src/Text/Pandoc/Readers/LaTeX.hs
+++ b/src/Text/Pandoc/Readers/LaTeX.hs
@@ -861,7 +861,8 @@ opt = bracketed inline
rawopt :: LP String
rawopt = do
- contents <- bracketed (many1 (noneOf "]") <|> try (string "\\]"))
+ contents <- bracketed (many1 (noneOf "[]") <|> try (string "\\]") <|>
+ try (string "\\[") <|> rawopt)
optional sp
return $ "[" ++ contents ++ "]"