diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-28 02:11:04 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-07-28 02:11:04 +0000 |
commit | cf87eb854d1e64c673073c46e7b9544738bad95f (patch) | |
tree | bff1f090108f27a5d5b811babe1287bc37022422 /src/Text/Pandoc | |
parent | d488dd0f66e14a7728873f31d80b51bab625b442 (diff) | |
download | pandoc-cf87eb854d1e64c673073c46e7b9544738bad95f.tar.gz |
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
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/Docbook.hs | 7 |
1 files changed, 6 insertions, 1 deletions
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 |