From ff9be6b38429b502b1582f2395b824305eb8c99c Mon Sep 17 00:00:00 2001
From: Albert Krewinkel <albert@zeitkraut.de>
Date: Tue, 31 Mar 2020 09:57:59 +0200
Subject: Jira writer: convert spans with class `underline` to inserted text

Spans with class `underline` as converted into Jira text marked as
`+inserted+`, i.e. surrounded by plus-signs.
---
 src/Text/Pandoc/Writers/Jira.hs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

(limited to 'src/Text/Pandoc/Writers')

diff --git a/src/Text/Pandoc/Writers/Jira.hs b/src/Text/Pandoc/Writers/Jira.hs
index 57de04cf5..d1a656687 100644
--- a/src/Text/Pandoc/Writers/Jira.hs
+++ b/src/Text/Pandoc/Writers/Jira.hs
@@ -206,7 +206,7 @@ toJiraInlines inlines = do
                                   then Jira.Linebreak
                                   else Jira.Space
         Space              -> pure . singleton $ Jira.Space
-        Span _attr xs      -> toJiraInlines xs
+        Span attr xs       -> spanToJira attr xs
         Str s              -> pure $ escapeSpecialChars s
         Strikeout xs       -> styled Jira.Strikeout xs
         Strong xs          -> styled Jira.Strong xs
@@ -263,6 +263,14 @@ quotedToJira qtype xs = do
   let surroundWithQuotes = (Jira.Str quoteChar :) . (++ [Jira.Str quoteChar])
   surroundWithQuotes <$> toJiraInlines xs
 
+spanToJira :: PandocMonad m
+           => Attr -> [Inline]
+           -> JiraConverter m [Jira.Inline]
+spanToJira (_, classes, _) =
+  if "underline" `elem` classes
+  then styled Jira.Insert
+  else toJiraInlines
+
 registerNotes :: PandocMonad m => [Block] -> JiraConverter m [Jira.Inline]
 registerNotes contents = do
   curNotes <- gets stNotes
-- 
cgit v1.2.3