fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
523 stars 55 forks source link

paragraph level elements parsed inside tables #17

Closed jcoulombe closed 13 years ago

jcoulombe commented 13 years ago

MMD parsing inside tables causes issues. For example, this simple but reasonable example triggers a block quote inside a table, which causes errors in latex.

$ cat tableQuote.txt 
| Item   | Price ($) |
|--------|-----------|
| Small  | < 1       |
| Large  | > 10      |

$ multimarkdown -t latex tableQuote.txt 
\begin{table}[htbp]
\begin{minipage}{\linewidth}
\setlength{\tymax}{0.5\linewidth}
\centering
\small
\begin{tabular}{@{}ll@{}} \\ \toprule
Item &Price (\$)  \\
\midrule
Small &$<$ 1  \\
Large &\begin{quote}10
\end{quote} \\

\bottomrule

\end{tabular}
\end{minipage}
\end{table}
fletcher commented 13 years ago

I had to make a major change to the table cell parsing to prevent if from matching block level elements.

It passes all of my tests, but I would appreciate testing with more real life tables.