summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/AsciiDoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-02 19:39:30 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-02 19:39:30 -0800
commitbdec07bac9efb737dbc60e6985d8ba1500a5eeb9 (patch)
tree5362789da366fe94f39cbbb843891fba3c2b46b1 /src/Text/Pandoc/Writers/AsciiDoc.hs
parentc6456ef8a4d3e0412ae7c2c78433cfcbe29aea9f (diff)
Shared: Removed unescapeURI, modified escapeURI.
escapeURI now only escapes space characters, leaving unicode characters as they are, instead of converting them to octets and URL-encoding them, as before. This gives more readable URIs. User agents now do the percent-encoding themselves. URIs are no longer unescaped at all on conversion to markdown, asciidoc, rst, org. Closes #349.
Diffstat (limited to 'src/Text/Pandoc/Writers/AsciiDoc.hs')
-rw-r--r--src/Text/Pandoc/Writers/AsciiDoc.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/AsciiDoc.hs b/src/Text/Pandoc/Writers/AsciiDoc.hs
index ab2b01656..f45c20e9e 100644
--- a/src/Text/Pandoc/Writers/AsciiDoc.hs
+++ b/src/Text/Pandoc/Writers/AsciiDoc.hs
@@ -336,12 +336,11 @@ 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 src = unescapeURI src'
let isRelative = ':' `notElem` src
let prefix = if isRelative
then text "link:"
@@ -353,7 +352,7 @@ inlineToAsciiDoc opts (Link txt (src', _tit)) = do
return $ if useAuto
then text srcSuffix
else prefix <> text src <> "[" <> linktext <> "]"
-inlineToAsciiDoc opts (Image alternate (src', tit)) = do
+inlineToAsciiDoc opts (Image alternate (src, tit)) = do
-- image:images/logo.png[Company logo, title="blah"]
let txt = if (null alternate) || (alternate == [Str ""])
then [Str "image"]
@@ -362,7 +361,6 @@ inlineToAsciiDoc opts (Image alternate (src', tit)) = do
let linktitle = if null tit
then empty
else text $ ",title=\"" ++ tit ++ "\""
- let src = unescapeURI src'
return $ "image:" <> text src <> "[" <> linktext <> linktitle <> "]"
inlineToAsciiDoc opts (Note [Para inlines]) =
inlineToAsciiDoc opts (Note [Plain inlines])