summaryrefslogtreecommitdiff
path: root/tests/writer.mediawiki
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-18 06:45:23 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2010-03-18 06:45:23 +0000
commitff68dd388390a110897d37fc8eff2219eb6ed1aa (patch)
treed9ecb5a02719ae469ebe22df7a23a9b2e710426d /tests/writer.mediawiki
parentd7e5bb96a71336b110eca3fea2f31bb0bd5e2f91 (diff)
MediaWiki writer: make links to relative URLs wikilinks.
The new rule: If the link target is an absolute URL, an external link is created. Otherwise, a wikilink is created. Examples: 1. [label](/foo/bar) => [[foo/bar|label]] 2. [label](foo) => [[foo|label]] 3. [label](http://gitit.net/foo) => [http://gitit.net/foo label] Note on 1: We strip the leading / here, since otherwise we get a link to Help:Links/foo/bar. would it be better for 1 to become [http://{SERVERNAME}}/foo/bar label]? Perhaps, since this would guarantee the same link destination as you'd get if you used the HTML writer directly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1904 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'tests/writer.mediawiki')
-rw-r--r--tests/writer.mediawiki44
1 files changed, 22 insertions, 22 deletions
diff --git a/tests/writer.mediawiki b/tests/writer.mediawiki
index 942223c2d..5873ea831 100644
--- a/tests/writer.mediawiki
+++ b/tests/writer.mediawiki
@@ -5,7 +5,7 @@ This is a set of tests for pandoc. Most of them are adapted from John Gruber&rsq
= Headers =
-== Level 2 with an [http://{{SERVERNAME}}/url embedded link] ==
+== Level 2 with an [[url|embedded link]] ==
=== Level 3 with ''emphasis'' ===
@@ -430,7 +430,7 @@ This is ''emphasized'', and so ''is this''.
This is '''strong''', and so '''is this'''.
-An ''[http://{{SERVERNAME}}/url emphasized link]''.
+An ''[[url|emphasized link]]''.
'''''This is strong and em.'''''
@@ -558,48 +558,48 @@ Minus: -
== Explicit ==
-Just a [http://{{SERVERNAME}}/url/ URL].
+Just a [[url/|URL]].
-[http://{{SERVERNAME}}/url/ URL and title].
+[[url/|URL and title]].
-[http://{{SERVERNAME}}/url/ URL and title].
+[[url/|URL and title]].
-[http://{{SERVERNAME}}/url/ URL and title].
+[[url/|URL and title]].
-[http://{{SERVERNAME}}/url/ URL and title]
+[[url/|URL and title]]
-[http://{{SERVERNAME}}/url/ URL and title]
+[[url/|URL and title]]
-[http://{{SERVERNAME}}/url/with_underscore with_underscore]
+[[url/with_underscore|with_underscore]]
[mailto:nobody@nowhere.net Email link]
-[http://{{SERVERNAME}}/ Empty].
+[[|Empty]].
== Reference ==
-Foo [http://{{SERVERNAME}}/url/ bar].
+Foo [[url/|bar]].
-Foo [http://{{SERVERNAME}}/url/ bar].
+Foo [[url/|bar]].
-Foo [http://{{SERVERNAME}}/url/ bar].
+Foo [[url/|bar]].
-With [http://{{SERVERNAME}}/url/ embedded [brackets]].
+With [[url/|embedded [brackets]]].
-[http://{{SERVERNAME}}/url/ b] by itself should be a link.
+[[url/|b]] by itself should be a link.
-Indented [http://{{SERVERNAME}}/url once].
+Indented [[url|once]].
-Indented [http://{{SERVERNAME}}/url twice].
+Indented [[url|twice]].
-Indented [http://{{SERVERNAME}}/url thrice].
+Indented [[url|thrice]].
This should [not][] be a link.
<pre>[not]: /url</pre>
-Foo [http://{{SERVERNAME}}/url/ bar].
+Foo [[url/|bar]].
-Foo [http://{{SERVERNAME}}/url/ biz].
+Foo [[url/|biz]].
== With ampersands ==
@@ -607,9 +607,9 @@ Here&rsquo;s a [http://example.com/?foo=1&bar=2 link with an ampersand in the UR
Here&rsquo;s a link with an amersand in the link text: [http://att.com/ AT&amp;T].
-Here&rsquo;s an [http://{{SERVERNAME}}/script?foo=1&bar=2 inline link].
+Here&rsquo;s an [[script?foo=1&bar=2|inline link]].
-Here&rsquo;s an [http://{{SERVERNAME}}/script?foo=1&bar=2 inline link in pointy braces].
+Here&rsquo;s an [[script?foo=1&bar=2|inline link in pointy braces]].
== Autolinks ==