diff options
author | Clare Macrae <clare.macrae@googlemail.com> | 2013-07-15 09:35:04 +0100 |
---|---|---|
committer | Clare Macrae <clare.macrae@googlemail.com> | 2013-07-15 09:35:04 +0100 |
commit | b2a8731e32c27a230a970b747df13ad84d473b5d (patch) | |
tree | 1020be12121540b31b7f044a4fdd578d0be4c657 | |
parent | 660fb244721a83985f097886178c5a38f6c8194e (diff) | |
download | pandoc-b2a8731e32c27a230a970b747df13ad84d473b5d.tar.gz |
Weak implementation of hyperlinks for dokuwiki (#386)
TODO Simplify the code
-rw-r--r-- | src/Text/Pandoc/Writers/DokuWiki.hs | 2 | ||||
-rw-r--r-- | tests/writer.dokuwiki | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/Text/Pandoc/Writers/DokuWiki.hs b/src/Text/Pandoc/Writers/DokuWiki.hs index 0169e0931..b6929ad1e 100644 --- a/src/Text/Pandoc/Writers/DokuWiki.hs +++ b/src/Text/Pandoc/Writers/DokuWiki.hs @@ -386,7 +386,7 @@ inlineToDokuWiki opts (Link txt (src, _)) = do case txt of [Str s] | escapeURI s == src -> return src _ -> if isURI src - then return $ "[" ++ src ++ " " ++ label ++ "]" + then return $ "[[" ++ src ++ "|" ++ label ++ "]]" else return $ "[[" ++ src' ++ "|" ++ label ++ "]]" where src' = case src of '/':xs -> xs -- with leading / it's a diff --git a/tests/writer.dokuwiki b/tests/writer.dokuwiki index 0062de3b3..2a006f817 100644 --- a/tests/writer.dokuwiki +++ b/tests/writer.dokuwiki @@ -455,7 +455,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces: ‘He said, “I want to go.”’ Were you alive in the 70’s? -Here is some quoted ‘<code>code</code>’ and a “[http://example.com/?foo=1&bar=2 quoted link]”. +Here is some quoted ‘<code>code</code>’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”. Some dashes: one—two — three—four — five. @@ -563,7 +563,7 @@ Just a [[url/|URL]]. [[url/with_underscore|with_underscore]] -[mailto:nobody@nowhere.net Email link] +[[mailto:nobody@nowhere.net|Email link]] [[|Empty]]. @@ -594,9 +594,9 @@ Foo [[url/|biz]]. ===== With ampersands ===== -Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL]. +Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]]. -Here’s a link with an amersand in the link text: [http://att.com/ AT&T]. +Here’s a link with an amersand in the link text: [[http://att.com/|AT&T]]. Here’s an [[script?foo=1&bar=2|inline link]]. @@ -610,7 +610,7 @@ With an ampersand: http://example.com/?foo=1&bar=2 * http://example.com/ * It should. -An e-mail address: [mailto:nobody@nowhere.net nobody@nowhere.net] +An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]] <blockquote>Blockquoted: http://example.com/ </blockquote> @@ -640,7 +640,7 @@ Subsequent blocks are indented to show that they belong to the footnote (as with <pre> { <code> }</pre> If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. -</ref> This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is //easier// to type. Inline notes may contain [http://google.com links] and <code>]</code> verbatim characters, as well as [bracketed text]. +</ref> This should //not// be a footnote reference, because it contains a space.[^my note] Here is an inline note.<ref>This is //easier// to type. Inline notes may contain [[http://google.com|links]] and <code>]</code> verbatim characters, as well as [bracketed text]. </ref> <blockquote>Notes can go in quotes.<ref>In quote. |