mirror of
https://github.com/jgm/pandoc.git
synced 2026-08-23 16:56:43 +00:00
Jira writer: fix output of table headers
Headers were missing from tables. Fixes: #6035
This commit is contained in:
@@ -84,7 +84,7 @@ toJiraBlocks :: PandocMonad m => [Block] -> JiraConverter m [Jira.Block]
|
||||
toJiraBlocks blocks = do
|
||||
let convert = \case
|
||||
BlockQuote bs -> singleton . Jira.BlockQuote
|
||||
<$> toJiraBlocks bs -- FIXME!
|
||||
<$> toJiraBlocks bs
|
||||
BulletList items -> singleton . Jira.List Jira.CircleBullets
|
||||
<$> toJiraItems items
|
||||
CodeBlock attr cs -> toJiraCode attr cs
|
||||
@@ -100,9 +100,9 @@ toJiraBlocks blocks = do
|
||||
RawBlock fmt cs -> rawBlockToJira fmt cs
|
||||
Null -> return mempty
|
||||
Table _ _ _ hd body -> singleton <$> do
|
||||
headerRow <- if null hd
|
||||
then Just <$> toRow Jira.HeaderCell hd
|
||||
else pure Nothing
|
||||
headerRow <- if all null hd
|
||||
then pure Nothing
|
||||
else Just <$> toRow Jira.HeaderCell hd
|
||||
bodyRows <- mapM (toRow Jira.BodyCell) body
|
||||
let rows = case headerRow of
|
||||
Just header -> header : bodyRows
|
||||
|
||||
@@ -1,28 +1,33 @@
|
||||
Simple table with caption:
|
||||
|
||||
|| Right || Left || Center || Default ||
|
||||
| 12 | 12 | 12 | 12 |
|
||||
| 123 | 123 | 123 | 123 |
|
||||
| 1 | 1 | 1 | 1 |
|
||||
|
||||
Simple table without caption:
|
||||
|
||||
|| Right || Left || Center || Default ||
|
||||
| 12 | 12 | 12 | 12 |
|
||||
| 123 | 123 | 123 | 123 |
|
||||
| 1 | 1 | 1 | 1 |
|
||||
|
||||
Simple table indented two spaces:
|
||||
|
||||
|| Right || Left || Center || Default ||
|
||||
| 12 | 12 | 12 | 12 |
|
||||
| 123 | 123 | 123 | 123 |
|
||||
| 1 | 1 | 1 | 1 |
|
||||
|
||||
Multiline table with caption:
|
||||
|
||||
|| Centered Header || Left Aligned || Right Aligned || Default aligned ||
|
||||
| First | row | 12.0 | Example of a row that spans multiple lines. |
|
||||
| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |
|
||||
|
||||
Multiline table without caption:
|
||||
|
||||
|| Centered Header || Left Aligned || Right Aligned || Default aligned ||
|
||||
| First | row | 12.0 | Example of a row that spans multiple lines. |
|
||||
| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user