aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-13 13:59:18 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-13 13:59:50 -0700
commit17b2fd567bcd39171b2b01b5c4f19644443447e3 (patch)
tree9d061db0470be6579b687fc72b4ff03d1d6218f6 /src/Text
parent3b7d276ab056261972dfefc659648813bb9787d7 (diff)
downloadpandoc-17b2fd567bcd39171b2b01b5c4f19644443447e3.tar.gz
Fixed haddock comment.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Shared.hs16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index df39f77d8..3adf2a1f6 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -857,15 +857,13 @@ warn msg = do
-- | Remove intermediate "." and ".." directories from a path.
--
--- @
--- collapseFilePath "./foo" == "foo"
--- collapseFilePath "/bar/../baz" == "/baz"
--- collapseFilePath "/../baz" == "/../baz"
--- collapseFilePath "parent/foo/baz/../bar" == "parent/foo/bar"
--- collapseFilePath "parent/foo/baz/../../bar" == "parent/bar"
--- collapseFilePath "parent/foo/.." == "parent"
--- collapseFilePath "/parent/foo/../../bar" == "/bar"
--- @
+-- > collapseFilePath "./foo" == "foo"
+-- > collapseFilePath "/bar/../baz" == "/baz"
+-- > collapseFilePath "/../baz" == "/../baz"
+-- > collapseFilePath "parent/foo/baz/../bar" == "parent/foo/bar"
+-- > collapseFilePath "parent/foo/baz/../../bar" == "parent/bar"
+-- > collapseFilePath "parent/foo/.." == "parent"
+-- > collapseFilePath "/parent/foo/../../bar" == "/bar"
collapseFilePath :: FilePath -> FilePath
collapseFilePath = joinPath . reverse . foldl go [] . splitDirectories
where