diff options
-rw-r--r-- | src/Text/Pandoc/Readers/LaTeX/Parsing.hs | 6 | ||||
-rw-r--r-- | test/command/tex-group.md | 12 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs index 9437c23d9..a2dd61aee 100644 --- a/src/Text/Pandoc/Readers/LaTeX/Parsing.hs +++ b/src/Text/Pandoc/Readers/LaTeX/Parsing.hs @@ -612,19 +612,19 @@ braced' :: PandocMonad m => LP m Tok -> Int -> LP m [Tok] braced' getTok n = handleEgroup <|> handleBgroup <|> handleOther where handleEgroup = do - t <- egroup + t <- symbol '}' if n == 1 then return [] else (t:) <$> braced' getTok (n - 1) handleBgroup = do - t <- bgroup + t <- symbol '{' (t:) <$> braced' getTok (n + 1) handleOther = do t <- getTok (t:) <$> braced' getTok n braced :: PandocMonad m => LP m [Tok] -braced = bgroup *> braced' anyTok 1 +braced = symbol '{' *> braced' anyTok 1 -- URLs require special handling, because they can contain % -- characters. So we retonenize comments as we go... diff --git a/test/command/tex-group.md b/test/command/tex-group.md new file mode 100644 index 000000000..277b32142 --- /dev/null +++ b/test/command/tex-group.md @@ -0,0 +1,12 @@ +``` +% pandoc -f latex -t html +\newenvironment{foo}% +{\emph\bgroup}% +{\egroup} + +\begin{foo} +hi +\end{foo} +^D +<p><em>hi</em></p> +``` |