aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-03-13 14:28:30 +0100
committerAlbert Krewinkel <albert@zeitkraut.de>2021-03-13 14:29:47 +0100
commit00e8d0678edac34af7a412642fbf7d85442b15aa (patch)
treebbc5033b5afdce7f9baa85c7699a389c934e8011
parenta8aa301428752d96cdd58d7f4ecaa7d054f3505d (diff)
downloadpandoc-00e8d0678edac34af7a412642fbf7d85442b15aa.tar.gz
Jira reader: mark divs created from panels with class "panel".
Closes: tarleb/jira-wiki-markup#2
-rw-r--r--src/Text/Pandoc/Readers/Jira.hs4
-rw-r--r--test/Tests/Readers/Jira.hs6
2 files changed, 8 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Jira.hs b/src/Text/Pandoc/Readers/Jira.hs
index 5a5d0ee1e..89aecbf56 100644
--- a/src/Text/Pandoc/Readers/Jira.hs
+++ b/src/Text/Pandoc/Readers/Jira.hs
@@ -71,10 +71,10 @@ toPandocCodeBlocks langMay params txt =
Nothing -> []
in codeBlockWith ("", classes, map paramToPair params) txt
--- | Create a pandoc @'Div'@
+-- | Create a pandoc @'Div'@ from a panel.
toPandocDiv :: [Jira.Parameter] -> [Jira.Block] -> Blocks
toPandocDiv params =
- divWith ("", [], map paramToPair params) . foldMap jiraToPandocBlocks
+ divWith ("", ["panel"], map paramToPair params) . foldMap jiraToPandocBlocks
paramToPair :: Jira.Parameter -> (Text, Text)
paramToPair (Jira.Parameter key value) = (key, value)
diff --git a/test/Tests/Readers/Jira.hs b/test/Tests/Readers/Jira.hs
index 189b504f7..cb7dde4ea 100644
--- a/test/Tests/Readers/Jira.hs
+++ b/test/Tests/Readers/Jira.hs
@@ -96,6 +96,12 @@ tests =
simpleTable [para "Name"] [[para "Test"]]
]
+ , testGroup "panel"
+ [ "simple panel" =:
+ "{panel}\nInterviewer: Jane Doe{panel}\n" =?>
+ divWith ("", ["panel"], []) (para "Interviewer: Jane Doe")
+ ]
+
, testGroup "inlines"
[ "emphasis" =:
"*quid pro quo*" =?>