From cf87eb854d1e64c673073c46e7b9544738bad95f Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Sat, 28 Jul 2007 02:11:04 +0000 Subject: [PATCH] Fixed a bug in Docbook writer: email links with text were being incorrectly treated as autolinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@809 788f1e2b-df1e-0410-8736-df70ead52e1b --- src/Text/Pandoc/Writers/Docbook.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Writers/Docbook.hs b/src/Text/Pandoc/Writers/Docbook.hs index 21cbbefa4..4824f81da 100644 --- a/src/Text/Pandoc/Writers/Docbook.hs +++ b/src/Text/Pandoc/Writers/Docbook.hs @@ -255,7 +255,12 @@ inlineToDocbook opts LineBreak = inlineToDocbook opts Space = char ' ' inlineToDocbook opts (Link txt (src, tit)) = if isPrefixOf "mailto:" src - then inTagsSimple "email" $ text (escapeStringForXML $ drop 7 src) + then let src' = drop 7 src + emailLink = inTagsSimple "email" $ text (escapeStringForXML $ src') + in if txt == [Code src'] + then emailLink + else inlinesToDocbook opts txt <+> char '(' <> emailLink <> + char ')' else inTags False "ulink" [("url", src)] $ inlinesToDocbook opts txt inlineToDocbook opts (Image alt (src, tit)) = let titleDoc = if null tit