aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2021-05-24 09:56:02 +0200
committerAlbert Krewinkel <albert@zeitkraut.de>2021-05-24 09:56:02 +0200
commit58fbf56548bf985b40e4338befaf5b11a0665cbe (patch)
tree9b5323b9e5be708a10c4caae16fa2411e30178bf /src/Text/Pandoc/Writers
parentc5f9446646a9add4a339a49ac8165e16474fa898 (diff)
downloadpandoc-58fbf56548bf985b40e4338befaf5b11a0665cbe.tar.gz
Jira writer: use `{color}` when span has a color attribute
Closes: tarleb/jira-wiki-markup#10
Diffstat (limited to 'src/Text/Pandoc/Writers')
-rw-r--r--src/Text/Pandoc/Writers/Jira.hs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs
index aa78d9419..cf4dadebc 100644
--- a/src/Text/Pandoc/Writers/Jira.hs
+++ b/src/Text/Pandoc/Writers/Jira.hs
@@ -309,9 +309,13 @@ quotedToJira qtype xs = do
spanToJira :: PandocMonad m
=> Attr -> [Inline]
-> JiraConverter m [Jira.Inline]
-spanToJira (ident, _classes, _attribs) inls = case ident of
- "" -> toJiraInlines inls
- _ -> (Jira.Anchor ident :) <$> toJiraInlines inls
+spanToJira (ident, _classes, attribs) inls =
+ let wrap = case lookup "color" attribs of
+ Nothing -> id
+ Just color -> singleton . Jira.ColorInline (Jira.ColorName color)
+ in wrap <$> case ident of
+ "" -> toJiraInlines inls
+ _ -> (Jira.Anchor ident :) <$> toJiraInlines inls
registerNotes :: PandocMonad m => [Block] -> JiraConverter m [Jira.Inline]
registerNotes contents = do