mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-03 22:25:53 +00:00
Previously the parser just failed if the column width
specified in `p{}` wasn't a multiple of `\linewidth`.
This led to cases where content was skipped.
Now we treat these as ColWidthDefault and silently
parse the table.
A future improvement could be to guess relative column
widths from the dimensions specified, based on a default
line width.
Closes #9579.
47 lines
935 B
Markdown
47 lines
935 B
Markdown
```
|
|
% pandoc -t native
|
|
\begin{tabular}{p{2in}}
|
|
\end{tabular}
|
|
|
|
# Test
|
|
|
|
\begin{tabular}{p{2\linewidth}}
|
|
\end{tabular}
|
|
^D
|
|
[ RawBlock
|
|
(Format "tex") "\\begin{tabular}{p{2in}}\n\\end{tabular}"
|
|
, Header 1 ( "test" , [] , [] ) [ Str "Test" ]
|
|
, RawBlock
|
|
(Format "tex")
|
|
"\\begin{tabular}{p{2\\linewidth}}\n\\end{tabular}"
|
|
]
|
|
```
|
|
|
|
```
|
|
% pandoc -f latex -t native
|
|
\begin{tabular}{p{2in}}
|
|
\end{tabular}
|
|
|
|
Test
|
|
|
|
\begin{tabular}{p{2\linewidth}}
|
|
\end{tabular}
|
|
^D
|
|
[ Table
|
|
( "" , [] , [] )
|
|
(Caption Nothing [])
|
|
[ ( AlignLeft , ColWidthDefault ) ]
|
|
(TableHead ( "" , [] , [] ) [])
|
|
[ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]
|
|
(TableFoot ( "" , [] , [] ) [])
|
|
, Para [ Str "Test" ]
|
|
, Table
|
|
( "" , [] , [] )
|
|
(Caption Nothing [])
|
|
[ ( AlignLeft , ColWidth 2.0 ) ]
|
|
(TableHead ( "" , [] , [] ) [])
|
|
[ TableBody ( "" , [] , [] ) (RowHeadColumns 0) [] [] ]
|
|
(TableFoot ( "" , [] , [] ) [])
|
|
]
|
|
```
|