LaTeX reader: be more tolerant of & character.

This allows us to parse unknown tabular environments
as raw LaTeX.  Closes #4208.
This commit is contained in:
John MacFarlane 2017-12-28 08:38:42 -08:00
parent 2278cd5e77
commit 3c93ac5cf0
2 changed files with 19 additions and 1 deletions

View file

@ -1726,7 +1726,7 @@ inline = (mempty <$ comment)
<|> (guardEnabled Ext_literate_haskell *> symbol '|' *> doLHSverb)
<|> (str . (:[]) <$> primEscape)
<|> regularSymbol
<|> (do res <- symbolIn "#^'`\"[]"
<|> (do res <- symbolIn "#^'`\"[]&"
pos <- getPosition
let s = T.unpack (untoken res)
report $ ParsingUnescaped s pos

18
test/command/4208.md Normal file
View file

@ -0,0 +1,18 @@
```
% pandoc -t latex
What is a _piffle_? Mark the correct answer(s):
\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|}
(a) a subnormal woffle & $\Box$ \\
(b) an infinite-dimensional baffle & $\Box$ \\
(c) an inverted first-order triffle & $\Box$ \\
\end{TAB}
^D
What is a \emph{piffle}? Mark the correct answer(s):
\begin{TAB}(@)[6pt]{|l|c|}{|c|c|c|}
(a) a subnormal woffle & $\Box$ \\
(b) an infinite-dimensional baffle & $\Box$ \\
(c) an inverted first-order triffle & $\Box$ \\
\end{TAB}
```