diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-10-30 12:37:08 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-10-30 12:37:08 -0700 |
commit | eb8aee477db045a7449bc752975528263964b8ce (patch) | |
tree | f9a060418e1c5253b8f6b090720b4600011e3f17 /tests | |
parent | 7843b5759a6c086dc29b7a2cdfa2bbb4ed2732ff (diff) | |
download | pandoc-eb8aee477db045a7449bc752975528263964b8ce.tar.gz |
Pipe tables with long lines now get relative cell widths.
If a pipe table contains a line longer than the column
width (as set by `--columns` or 80 by default), relative
widths are computed based on the widths of the separator lines
relative to the column width.
This should solve persistent problems with long pipe tables in
LaTeX/PDF output, and give more flexibility for determining
relative column widths in other formats, too.
For narrower pipe tables, column widths of 0 are used,
telling pandoc not to specify widths explicitly in output
formats that permit this.
Closes #2471.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/pipe-tables.native | 13 | ||||
-rw-r--r-- | tests/pipe-tables.txt | 7 |
2 files changed, 19 insertions, 1 deletions
diff --git a/tests/pipe-tables.native b/tests/pipe-tables.native index 9d499c9c2..f52175ff0 100644 --- a/tests/pipe-tables.native +++ b/tests/pipe-tables.native @@ -83,4 +83,15 @@ [[[Plain [Str "3"]] ,[Plain [Str "33"]]] ,[[Plain [Str "4"]] - ,[Plain [Str "44"]]]]] + ,[Plain [Str "44"]]]] +,Para [Str "Long",Space,Str "pipe",Space,Str "table",Space,Str "with",Space,Str "relative",Space,Str "widths:"] +,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.125,0.1375,0.5] + [[Plain [Str "Default1"]] + ,[Plain [Str "Default2"]] + ,[Plain [Str "Default3"]]] + [[[Plain [Str "123"]] + ,[Plain [Str "this",Space,Str "is",Space,Str "a",Space,Str "table",Space,Str "cell"]] + ,[Plain [Str "and",Space,Str "this",Space,Str "is",Space,Str "a",Space,Str "really",Space,Str "long",Space,Str "table",Space,Str "cell",Space,Str "that",Space,Str "will",Space,Str "probably",Space,Str "need",Space,Str "wrapping"]]] + ,[[Plain [Str "123"]] + ,[Plain [Str "123"]] + ,[Plain [Str "123"]]]]] diff --git a/tests/pipe-tables.txt b/tests/pipe-tables.txt index a8803724a..a5984b99b 100644 --- a/tests/pipe-tables.txt +++ b/tests/pipe-tables.txt @@ -59,3 +59,10 @@ Number of siblings | Salary ------------------:|:------ 3 | 33 4 | 44 + +Long pipe table with relative widths: + +| Default1 | Default2 | Default3 | + |---------|----------|---------------------------------------| +|123|this is a table cell|and this is a really long table cell that will probably need wrapping| +|123|123|123| |