From 00e8d0678edac34af7a412642fbf7d85442b15aa Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 13 Mar 2021 14:28:30 +0100 Subject: [PATCH] Jira reader: mark divs created from panels with class "panel". Closes: tarleb/jira-wiki-markup#2 --- src/Text/Pandoc/Readers/Jira.hs | 4 ++-- test/Tests/Readers/Jira.hs | 6 ++++++ 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*" =?>