git.iko.soy/typeable/pandoc
on master help sign in
Weak implementation of hyperlinks for dokuwiki (#386)
b2a8731Clare Macrae
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -386,7 +386,7 @@ inlineToDokuWiki opts (Link txt (src, _)) = do
386 case txt of
386 case txt of
387 [Str s] | escapeURI s == src -> return src
387 [Str s] | escapeURI s == src -> return src
388 _ -> if isURI src
388 _ -> if isURI src
389− then return $ "[" ++ src ++ " " ++ label ++ "]"
389+ then return $ "[[" ++ src ++ "|" ++ label ++ "]]"
390 else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
390 else return $ "[[" ++ src' ++ "|" ++ label ++ "]]"
391 where src' = case src of
391 where src' = case src of
392 '/':xs -> xs -- with leading / it's a
392 '/':xs -> xs -- with leading / it's a
tests/writer.dokuwiki+6−6
@@ -455,7 +455,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
455
455
456‘He said, “I want to go.”’ Were you alive in the 70’s?
456‘He said, “I want to go.”’ Were you alive in the 70’s?
457
457
458−Here is some quoted ‘<code>code</code>’ and a “[http://example.com/?foo=1&bar=2 quoted link]”.
458+Here is some quoted ‘<code>code</code>’ and a “[[http://example.com/?foo=1&bar=2|quoted link]]”.
459
459
460Some dashes: one—two — three—four — five.
460Some dashes: one—two — three—four — five.
461
461
@@ -563,7 +563,7 @@ Just a [[url/|URL]].
563
563
564[[url/with_underscore|with_underscore]]
564[[url/with_underscore|with_underscore]]
565
565
566−[mailto:nobody@nowhere.net Email link]
566+[[mailto:nobody@nowhere.net|Email link]]
567
567
568[[|Empty]].
568[[|Empty]].
569
569
@@ -594,9 +594,9 @@ Foo [[url/|biz]].
594
594
595===== With ampersands =====
595===== With ampersands =====
596
596
597−Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL].
597+Here’s a [[http://example.com/?foo=1&bar=2|link with an ampersand in the URL]].
598
598
599−Here’s a link with an amersand in the link text: [http://att.com/ AT&amp;T].
599+Here’s a link with an amersand in the link text: [[http://att.com/|AT&amp;T]].
600
600
601Here’s an [[script?foo=1&bar=2|inline link]].
601Here’s an [[script?foo=1&bar=2|inline link]].
602
602
@@ -610,7 +610,7 @@ With an ampersand: http://example.com/?foo=1&bar=2
610* http://example.com/
610* http://example.com/
611* It should.
611* It should.
612
612
613−An e-mail address: [mailto:nobody@nowhere.net nobody@nowhere.net]
613+An e-mail address: [[mailto:nobody@nowhere.net|nobody@nowhere.net]]
614
614
615<blockquote>Blockquoted: http://example.com/
615<blockquote>Blockquoted: http://example.com/
616</blockquote>
616</blockquote>
@@ -640,7 +640,7 @@ Subsequent blocks are indented to show that they belong to the footnote (as with
640
640
641<pre> { &lt;code&gt; }</pre>
641<pre> { &lt;code&gt; }</pre>
642If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
642If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.
643−</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].
643+</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].
644</ref>
644</ref>
645
645
646<blockquote>Notes can go in quotes.<ref>In quote.
646<blockquote>Notes can go in quotes.<ref>In quote.