summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Hörnquist <hugo@lysator.liu.se>2022-11-19 18:15:29 +0100
committerHugo Hörnquist <hugo@lysator.liu.se>2022-11-19 18:15:29 +0100
commit8525f5f1fdcb0b7d68a37e06eea5ff70ff54cb65 (patch)
treec0779459c49e1daf31d31af42bdaf11218bb5543
parentFix file: URI's containing weird characters. (diff)
downloadvimwiki-scripts-8525f5f1fdcb0b7d68a37e06eea5ff70ff54cb65.tar.gz
vimwiki-scripts-8525f5f1fdcb0b7d68a37e06eea5ff70ff54cb65.tar.xz
Wiki-links with trailing slash don't get .html in output.
-rw-r--r--hs/src/Html.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/hs/src/Html.hs b/hs/src/Html.hs
index 659db49..2decb24 100644
--- a/hs/src/Html.hs
+++ b/hs/src/Html.hs
@@ -10,14 +10,15 @@ module Html
import System.FilePath
( joinPath
- , takeDirectory
- , (</>)
, (-<.>)
, (<.>)
- , hasExtension
+ , (</>)
, dropExtension
- , takeBaseName
+ , hasExtension
+ , hasTrailingPathSeparator
, isRelative
+ , takeBaseName
+ , takeDirectory
)
import Control.Lens (_2)
import Control.Lens.Operators hiding ((<.>))
@@ -116,6 +117,7 @@ urlRewrites conf = M.fromList $ mapMaybe sequence
fixExtension url
| hasExtension url = url
+ | hasTrailingPathSeparator url = url
| otherwise = url <.> "html"