git.iko.soy/typeable/pandoc
on master help sign in
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

commitcf87eb854d1e64c673073c46e7b9544738bad95f authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 28 Jul 2007, 02:11 (19 years ago) parentd488dd0
1 file changed+6−1
src/Text/Pandoc/Writers/Docbook.hs+6−1
src/Text/Pandoc/Writers/Docbook.hs+6−1
@@ -255,7 +255,12 @@ inlineToDocbook opts LineBreak =
255255inlineToDocbook opts Space = char ' '
256256inlineToDocbook opts (Link txt (src, tit)) =
257257 if isPrefixOf "mailto:" src
258− then inTagsSimple "email" $ text (escapeStringForXML $ drop 7 src)
258+ then let src' = drop 7 src
259+ emailLink = inTagsSimple "email" $ text (escapeStringForXML $ src')
260+ in if txt == [Code src']
261+ then emailLink
262+ else inlinesToDocbook opts txt <+> char '(' <> emailLink <>
263+ char ')'
259264 else inTags False "ulink" [("url", src)] $ inlinesToDocbook opts txt
260265inlineToDocbook opts (Image alt (src, tit)) =
261266 let titleDoc = if null tit