aboutsummaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-05-01 08:44:05 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-05-01 08:44:05 -0700
commitb306405caaaee9b43a61533fdce772ccbe934e1f (patch)
treeb020bad58bb22e37732ff1fd6568556a4f159fd4 /tests/Tests
parentac104c4fdb957937c163a558348934a95fc13727 (diff)
parent8726eebcd363ccb33ea8c297b004feca7ef37ceb (diff)
downloadpandoc-b306405caaaee9b43a61533fdce772ccbe934e1f.tar.gz
Merge pull request #1272 from tarleb/link-types
Org reader: add support for custom link types
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Org.hs26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index 96747d148..78684f0f1 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -304,6 +304,32 @@ tests =
] =?>
(para (spanWith ("link-here", [], []) mempty <> "Target.") <>
para (emph ("See" <> space <> "here!")))
+
+ , "Link abbreviation" =:
+ unlines [ "#+LINK: wp https://en.wikipedia.org/wiki/%s"
+ , "[[wp:Org_mode][Wikipedia on Org-mode]]"
+ ] =?>
+ (para (link "https://en.wikipedia.org/wiki/Org_mode" ""
+ ("Wikipedia" <> space <> "on" <> space <> "Org-mode")))
+
+ , "Link abbreviation, defined after first use" =:
+ unlines [ "[[zl:non-sense][Non-sense articles]]"
+ , "#+LINK: zl http://zeitlens.com/tags/%s.html"
+ ] =?>
+ (para (link "http://zeitlens.com/tags/non-sense.html" ""
+ ("Non-sense" <> space <> "articles")))
+
+ , "Link abbreviation, URL encoded arguments" =:
+ unlines [ "#+link: expl http://example.com/%h/foo"
+ , "[[expl:Hello, World!][Moin!]]"
+ ] =?>
+ (para (link "http://example.com/Hello%2C%20World%21/foo" "" "Moin!"))
+
+ , "Link abbreviation, append arguments" =:
+ unlines [ "#+link: expl http://example.com/"
+ , "[[expl:foo][bar]]"
+ ] =?>
+ (para (link "http://example.com/foo" "" "bar"))
]
, testGroup "Basic Blocks" $