Jira reader: mark divs created from panels with class "panel".

Closes: tarleb/jira-wiki-markup#2
This commit is contained in:
Albert Krewinkel 2021-03-13 14:28:30 +01:00
parent a8aa301428
commit 00e8d0678e
No known key found for this signature in database
GPG key ID: 388DC0B21F631124
2 changed files with 8 additions and 2 deletions

View file

@ -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)

View file

@ -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*" =?>