summaryrefslogtreecommitdiff
path: root/tests/Tests
diff options
context:
space:
mode:
authorAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-25 15:29:28 +0200
committerAlbert Krewinkel <tarleb@moltkeplatz.de>2014-04-25 15:29:28 +0200
commit2eec20d92fd0f498da5b66ac03cf6f8159392323 (patch)
tree47d83533d9841d49b5e763a96bbb3ccdb25b8c99 /tests/Tests
parent2f724aaaa4875a21560870d25c3d212f974c6dde (diff)
Org reader: Enable internal links
Internal links in Org are possible by using an anchor-name as the target of a link: [[some-anchor][This]] is an internal link. It links <<some-anchor>> here.
Diffstat (limited to 'tests/Tests')
-rw-r--r--tests/Tests/Readers/Org.hs25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index ed774f527..96747d148 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -202,6 +202,11 @@ tests =
, link "http://moltkeplatz.de" "" "http://moltkeplatz.de"
, "for", "fnords."
])
+
+ , "Anchor" =:
+ "<<anchor>> Link here later." =?>
+ (para $ spanWith ("anchor", [], []) mempty <>
+ "Link" <> space <> "here" <> space <> "later.")
]
, testGroup "Meta Information" $
@@ -279,6 +284,26 @@ tests =
, ":END:"
] =?>
para (":FOO:" <> space <> ":END:")
+
+ , "Anchor reference" =:
+ unlines [ "<<link-here>> Target."
+ , ""
+ , "[[link-here][See here!]]"
+ ] =?>
+ (para (spanWith ("link-here", [], []) mempty <> "Target.") <>
+ para (link "#link-here" "" ("See" <> space <> "here!")))
+
+ , "Search links are read as emph" =:
+ "[[Wally][Where's Wally?]]" =?>
+ (para (emph $ "Where's" <> space <> "Wally?"))
+
+ , "Link to nonexistent anchor" =:
+ unlines [ "<<link-here>> Target."
+ , ""
+ , "[[link$here][See here!]]"
+ ] =?>
+ (para (spanWith ("link-here", [], []) mempty <> "Target.") <>
+ para (emph ("See" <> space <> "here!")))
]
, testGroup "Basic Blocks" $