summaryrefslogtreecommitdiff
path: root/test/command
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2022-01-19 09:21:51 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2022-01-19 09:36:48 -0800
commit6723891c722a758d8d7aef094c435c9f8daa60e9 (patch)
tree9ebe49a083acaf06611d4dea4437d8373649da82 /test/command
parentb794b534a51c8a9e3140cb500a0b03e172b69759 (diff)
Markdown writer: handle explicit column widths with pipe tables.
If a table has explicit column width information *and* the content extends beyond the `--columns` width, we need to adjust the widths of the pipe separators to encode this width information. Closes #7847.
Diffstat (limited to 'test/command')
-rw-r--r--test/command/3734.md4
-rw-r--r--test/command/7847.md85
2 files changed, 87 insertions, 2 deletions
diff --git a/test/command/3734.md b/test/command/3734.md
index f65b1cfd3..6bdf1a14b 100644
--- a/test/command/3734.md
+++ b/test/command/3734.md
@@ -5,7 +5,7 @@
| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
^D
| aaaaaaaaaaaa | bbbbb | ccccccccccc |
-|--------------|-------|--------------------------------------------------------------------------|
+|------------|-------|------------------------------------------------------|
| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
```
@@ -16,7 +16,7 @@
| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
^D
| aaaaaaaaaaaa | bbbbb | ccccccccccc |
-|--------------|-------|--------------------------------------------------------------------------|
+|------------|-------|------------------------------------------------------|
| aaaaaaaaaaaa | | cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc |
```
diff --git a/test/command/7847.md b/test/command/7847.md
new file mode 100644
index 000000000..e714f3e00
--- /dev/null
+++ b/test/command/7847.md
@@ -0,0 +1,85 @@
+```
+% pandoc -f html -t markdown_strict+pipe_tables
+<table>
+<colgroup>
+<col style="width: 20%" />
+<col style="width: 60%" />
+<col style="width: 20%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>aaa</th>
+<th>bbb</th>
+<th>ccc</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique
+sit amet, rhoncus porta, malesuada elementum, nisi.</td>
+<td></td>
+<td>ccc</td>
+</tr>
+</tbody>
+</table>
+^D
+| aaa | bbb | ccc |
+|---------------|------------------------------------------|---------------|
+| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. | | ccc |
+
+```
+
+```
+% pandoc -f html -t markdown_strict+pipe_tables
+<table>
+<tr>
+<th>aaa</th>
+<th>bbb</th>
+<th>ccc</th>
+</tr>
+<tr>
+<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique
+sit amet, rhoncus porta, malesuada elementum, nisi.</td>
+<td></td>
+<td>ccc</td>
+</tr>
+</table>
+^D
+| aaa | bbb | ccc |
+|-------------------------------------------------------------------------------------------------------------|-----|-----|
+| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. | | ccc |
+
+```
+
+```
+% pandoc -f html -t commonmark+pipe_tables
+<table>
+<colgroup>
+<col style="width: 20%" />
+<col style="width: 60%" />
+<col style="width: 20%" />
+</colgroup>
+<thead>
+<tr class="header">
+<th>aaa</th>
+<th>bbb</th>
+<th>ccc</th>
+</tr>
+</thead>
+<tbody>
+<tr class="odd">
+<td>Consequat nisi sit amet nibh. Nunc mi tortor, tristique
+sit amet, rhoncus porta, malesuada elementum, nisi.</td>
+<td>bbb</td>
+<td>ccc</td>
+</tr>
+</tbody>
+</table>
+^D
+| aaa | bbb | ccc |
+|-------------------------------------------------------------------------------------------------------------|-----|-----|
+| Consequat nisi sit amet nibh. Nunc mi tortor, tristique sit amet, rhoncus porta, malesuada elementum, nisi. | bbb | ccc |
+
+```
+
+