diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-10-31 22:04:22 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-10-31 22:04:22 +0100 |
commit | 5d02e478d0524cee52991740ffdf0ee87296b5d4 (patch) | |
tree | fc536f04379ad02c400fccb358fefe40040b9d45 /src | |
parent | 4f06e6c4455b5b6be21416e9736a70f8d2b1ff1c (diff) | |
download | pandoc-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')
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX.hs | 3 |
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 ++ "]" |