aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-04-25 08:08:00 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-04-25 08:08:00 -0700
commit60297089f642818599b925c5e3bd7ecdfbf93c1d (patch)
tree5466dcff5cd5529eadca899577da4c918d85f228 /tests
parentcbeb3bb2132908b76e3a83e61ff99418ebdf83b4 (diff)
parentb09412d852880a0c8e18e1cab9b0ce33f0e0e8a2 (diff)
downloadpandoc-60297089f642818599b925c5e3bd7ecdfbf93c1d.tar.gz
Merge pull request #1265 from tarleb/org-links
Improvements handling of internal links
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Org.hs39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs
index f62b73ce4..96747d148 100644
--- a/tests/Tests/Readers/Org.hs
+++ b/tests/Tests/Readers/Org.hs
@@ -188,6 +188,25 @@ tests =
, "Image link" =:
"[[sunset.png][dusk.svg]]" =?>
(para $ link "sunset.png" "" (image "dusk.svg" "" ""))
+
+ , "Plain link" =:
+ "Posts on http://zeitlens.com/ can be funny at times." =?>
+ (para $ spcSep [ "Posts", "on"
+ , link "http://zeitlens.com/" "" "http://zeitlens.com/"
+ , "can", "be", "funny", "at", "times."
+ ])
+
+ , "Angle link" =:
+ "Look at <http://moltkeplatz.de> for fnords." =?>
+ (para $ spcSep [ "Look", "at"
+ , 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" $
@@ -265,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" $