From f5af4903dfdad6b849f708f476832bdb07cca6a7 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 18 Nov 2011 18:31:32 -0800 Subject: Removed link title in asciidoc. Apparently it is not supported. --- src/Text/Pandoc/Writers/Asciidoc.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src') 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 ""]) -- cgit v1.2.3