Skip to content

Commit

Permalink
RST writer: don't wrap simple table header lines.
Browse files Browse the repository at this point in the history
Closes jgm#5128.
  • Loading branch information
jgm committed Dec 6, 2018
1 parent 38200c0 commit d5e68d4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Text/Pandoc/Writers/RST.hs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ simpleTable opts blocksToDoc headers rows = do
numChars xs = maximum . map offset $ xs
let colWidths = map numChars $ transpose (headerDocs : rowDocs)
let toRow = hsep . zipWith lblock colWidths
let hline = hsep (map (\n -> text (replicate n '=')) colWidths)
let hline = nowrap $ hsep (map (\n -> text (replicate n '=')) colWidths)
let hdr = if all null headers
then mempty
else hline $$ toRow headerDocs
Expand Down
18 changes: 18 additions & 0 deletions test/command/5128.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
```
pandoc -f org -t rst
| Option | Meaning |
|--------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| =<= | Left alignment, additional characters are added to the right (default for string). |
| =>= | Right alignment, additional characters are added to the left. |
| =^= | Centered , the same amount of characters is added to the left and the right. |
| === | Padding. If a numeric value is printed with a sign, then additional characters are added after the sign. Otherwise it behaves like "=>=". This option is only available for numbers (default for numbers). |
^D
====== ============================================================================================================================================================================================================
Option Meaning
====== ============================================================================================================================================================================================================
``<`` Left alignment, additional characters are added to the right (default for string).
``>`` Right alignment, additional characters are added to the left.
``^`` Centered , the same amount of characters is added to the left and the right.
``=`` Padding. If a numeric value is printed with a sign, then additional characters are added after the sign. Otherwise it behaves like "``>``". This option is only available for numbers (default for numbers).
====== ============================================================================================================================================================================================================
```

0 comments on commit d5e68d4

Please sign in to comment.