git.iko.soy/typeable/pandoc
on master help sign in
LaTeX reader: fixed regression with starred environment names.

Closes #3803.

commit56f63af3f6776d8f3d6466f928b0c294032444c6 authorJohn MacFarlane <jgm@berkeley.edu> dateWed 19 Jul 2017, 17:30 (9 years ago) parent3267af2
2 files changed+13−14
src/Text/Pandoc/Readers/LaTeX.hs+3−14 test/command/3803.md+10
src/Text/Pandoc/Readers/LaTeX.hs+3−14
@@ -1456,22 +1456,14 @@ begin_ :: PandocMonad m => Text -> LP m ()
14561456begin_ t = (try $ do
14571457 controlSeq "begin"
14581458 spaces
1459− symbol '{'
1460− spaces
1461− Tok _ Word txt <- satisfyTok isWordTok
1462− spaces
1463− symbol '}'
1459+ txt <- untokenize <$> braced
14641460 guard (t == txt)) <?> ("\\begin{" ++ T.unpack t ++ "}")
14651461
14661462end_ :: PandocMonad m => Text -> LP m ()
14671463end_ t = (try $ do
14681464 controlSeq "end"
14691465 spaces
1470− symbol '{'
1471− spaces
1472− Tok _ Word txt <- satisfyTok isWordTok
1473− spaces
1474− symbol '}'
1466+ txt <- untokenize <$> braced
14751467 guard $ t == txt) <?> ("\\end{" ++ T.unpack t ++ "}")
14761468
14771469preamble :: PandocMonad m => LP m Blocks
@@ -1571,11 +1563,8 @@ newenvironment = do
15711563 controlSeq "renewenvironment" <|>
15721564 controlSeq "provideenvironment"
15731565 optional $ symbol '*'
1574− symbol '{'
1575− spaces
1576− Tok _ Word name <- satisfyTok isWordTok
15771566 spaces
1578− symbol '}'
1567+ name <- untokenize <$> braced
15791568 spaces
15801569 numargs <- option 0 $ try bracketedNum
15811570 spaces
test/command/3803.mdnew file+10
@@ -0,0 +1,10 @@
1+```
2+% pandoc -f markdown+raw_tex -t latex
3+\begin{blah*}
4+*ok*
5+\end{blah*}
6+^D
7+\begin{blah*}
8+*ok*
9+\end{blah*}
10+```