diff options
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Asciidoc.hs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Asciidoc.hs b/src/Text/Pandoc/Writers/Asciidoc.hs index d4c9e3c33..f88594680 100644 --- a/src/Text/Pandoc/Writers/Asciidoc.hs +++ b/src/Text/Pandoc/Writers/Asciidoc.hs @@ -326,26 +326,23 @@ inlineToAsciidoc _ (RawInline _ _) = return empty inlineToAsciidoc _ (LineBreak) = return $ " +" <> cr inlineToAsciidoc _ Space = return space inlineToAsciidoc opts (Cite _ lst) = inlineListToAsciidoc opts lst -inlineToAsciidoc opts (Link txt (src', tit)) = do +inlineToAsciidoc opts (Link txt (src', _tit)) = do -- relative: link:downloads/foo.zip[download foo.zip] -- abs: http://google.cod[Google] -- or my@email.com[email john] linktext <- inlineListToAsciidoc opts txt - let linktitle = if null tit - then empty - else text $ ",title=\"" ++ tit ++ "\"" let src = unescapeURI src' - let isRelative = ':' `elem` src + let isRelative = ':' `notElem` src let prefix = if isRelative then text "link:" else empty let srcSuffix = if isPrefixOf "mailto:" src then drop 7 src else src - let useAuto = case (tit,txt) of - ("", [Code _ s]) | s == srcSuffix -> True - _ -> False + let useAuto = case txt of + [Code _ s] | s == srcSuffix -> True + _ -> False return $ if useAuto then text srcSuffix - else prefix <> text src <> "[" <> linktext <> linktitle <> "]" + else prefix <> text src <> "[" <> linktext <> "]" inlineToAsciidoc opts (Image alternate (src', tit)) = do -- image:images/logo.png[Company logo, title="blah"] let txt = if (null alternate) || (alternate == [Str ""]) |