aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Text/Pandoc/Writers/Jira.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs
index 573e13248..57de04cf5 100644
--- a/src/Text/Pandoc/Writers/Jira.hs
+++ b/src/Text/Pandoc/Writers/Jira.hs
@@ -191,7 +191,7 @@ toJiraInlines inlines = do
Code _ cs -> return . singleton $
Jira.Monospaced (escapeSpecialChars cs)
Emph xs -> styled Jira.Emphasis xs
- Image _ _ (src, _) -> pure . singleton $ Jira.Image [] (Jira.URL src)
+ Image attr _ tgt -> imageToJira attr (fst tgt) (snd tgt)
LineBreak -> pure . singleton $ Jira.Linebreak
Link _ xs (tgt, _) -> singleton . flip Jira.Link (Jira.URL tgt)
<$> toJiraInlines xs
@@ -230,6 +230,18 @@ escapeSpecialChars t = case plainText t of
Right xs -> xs
Left _ -> singleton $ Jira.Str t
+imageToJira :: PandocMonad m
+ => Attr -> Text -> Text
+ -> JiraConverter m [Jira.Inline]
+imageToJira (_, classes, kvs) src title =
+ let imgParams = if "thumbnail" `elem` classes
+ then [Jira.Parameter "thumbnail" ""]
+ else map (uncurry Jira.Parameter) kvs
+ imgParams' = if T.null title
+ then imgParams
+ else Jira.Parameter "title" title : imgParams
+ in pure . singleton $ Jira.Image imgParams' (Jira.URL src)
+
mathToJira :: PandocMonad m
=> MathType
-> Text