git.iko.soy/typeable/pandoc
on master help sign in
Jira writer: fix output of table headers

Headers were missing from tables. Fixes: #6035

commitbef0133fe044350caeee24cdf79203a9306534da authorAlbert Krewinkel <albert@zeitkraut.de> dateTue 7 Jan 2020, 20:45 (7 years ago) parentad5f7ec
2 files changed+9−4
src/Text/Pandoc/Writers/Jira.hs+4−4 test/tables.jira+5
src/Text/Pandoc/Writers/Jira.hs+4−4
@@ -84,7 +84,7 @@ toJiraBlocks :: PandocMonad m => [Block] -> JiraConverter m [Jira.Block]
8484toJiraBlocks blocks = do
8585 let convert = \case
8686 BlockQuote bs -> singleton . Jira.BlockQuote
87− <$> toJiraBlocks bs -- FIXME!
87+ <$> toJiraBlocks bs
8888 BulletList items -> singleton . Jira.List Jira.CircleBullets
8989 <$> toJiraItems items
9090 CodeBlock attr cs -> toJiraCode attr cs
@@ -100,9 +100,9 @@ toJiraBlocks blocks = do
100100 RawBlock fmt cs -> rawBlockToJira fmt cs
101101 Null -> return mempty
102102 Table _ _ _ hd body -> singleton <$> do
103− headerRow <- if null hd
104− then Just <$> toRow Jira.HeaderCell hd
105− else pure Nothing
103+ headerRow <- if all null hd
104+ then pure Nothing
105+ else Just <$> toRow Jira.HeaderCell hd
106106 bodyRows <- mapM (toRow Jira.BodyCell) body
107107 let rows = case headerRow of
108108 Just header -> header : bodyRows
test/tables.jira+5
@@ -1,28 +1,33 @@
11Simple table with caption:
22
3+|| Right || Left || Center || Default ||
34| 12 | 12 | 12 | 12 |
45| 123 | 123 | 123 | 123 |
56| 1 | 1 | 1 | 1 |
67
78Simple table without caption:
89
10+|| Right || Left || Center || Default ||
911| 12 | 12 | 12 | 12 |
1012| 123 | 123 | 123 | 123 |
1113| 1 | 1 | 1 | 1 |
1214
1315Simple table indented two spaces:
1416
17+|| Right || Left || Center || Default ||
1518| 12 | 12 | 12 | 12 |
1619| 123 | 123 | 123 | 123 |
1720| 1 | 1 | 1 | 1 |
1821
1922Multiline table with caption:
2023
24+|| Centered Header || Left Aligned || Right Aligned || Default aligned ||
2125| First | row | 12.0 | Example of a row that spans multiple lines. |
2226| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |
2327
2428Multiline table without caption:
2529
30+|| Centered Header || Left Aligned || Right Aligned || Default aligned ||
2631| First | row | 12.0 | Example of a row that spans multiple lines. |
2732| Second | row | 5.0 | Here’s another one. Note the blank line between rows. |
2833