aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Textile.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-11-06 16:05:17 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2012-11-06 16:05:17 -0800
commit4cd573c61f61885cb368b40dccd1b458c39846c7 (patch)
treec8fe5e6d7429b1d14fbe6b6ae1bfcd797b8fe626 /src/Text/Pandoc/Writers/Textile.hs
parent4aa3e1f978fc285d16f047c800504b03cc897ec8 (diff)
downloadpandoc-4cd573c61f61885cb368b40dccd1b458c39846c7.tar.gz
Textile reader/writer: Fixed autolinks.
Previously the textile reader and writer incorrectly implented RST-style autolinks for URLs and email addresses. This has been fixed. Now an autolink is done this way: "$":http://myurl.com
Diffstat (limited to 'src/Text/Pandoc/Writers/Textile.hs')
-rw-r--r--src/Text/Pandoc/Writers/Textile.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Textile.hs b/src/Text/Pandoc/Writers/Textile.hs
index 5f3bb6bcd..44fdc7efb 100644
--- a/src/Text/Pandoc/Writers/Textile.hs
+++ b/src/Text/Pandoc/Writers/Textile.hs
@@ -396,7 +396,10 @@ inlineToTextile _ Space = return " "
inlineToTextile opts (Link txt (src, _)) = do
label <- case txt of
- [Code _ s] -> return s
+ [Code _ s]
+ | s == src -> return "$"
+ [Str s]
+ | s == src -> return "$"
_ -> inlineListToTextile opts txt
return $ "\"" ++ label ++ "\":" ++ src