aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-11-18 18:31:32 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-11-18 18:31:32 -0800
commitf5af4903dfdad6b849f708f476832bdb07cca6a7 (patch)
tree3a1b2f42f2c520767eb3a351cdb1f391c7e3030c
parent965c9415b0daed39e5c7d43f413d99b32645cc2f (diff)
downloadpandoc-f5af4903dfdad6b849f708f476832bdb07cca6a7.tar.gz
Removed link title in asciidoc.
Apparently it is not supported.
-rw-r--r--src/Text/Pandoc/Writers/Asciidoc.hs15
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 ""])