Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix wiki links when `base-url` is set to empty and `absolute-urls` to…

… yes
  • Loading branch information...
commit fcedb4b0f71f9b517293ebb1fc80c582f6ff1054 1 parent 7ef1736
@tianyicui authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 Network/Gitit/ContentTransformer.hs
View
6 Network/Gitit/ContentTransformer.hs
@@ -525,7 +525,11 @@ wikiLinksTransform pandoc
-- | Convert links with no URL to wikilinks.
convertWikiLinks :: Config -> Inline -> Inline
convertWikiLinks cfg (Link ref ("", "")) | useAbsoluteUrls cfg =
- Link ref (baseUrl cfg </> inlinesToURL ref, "Go to wiki page")
+ let linkBaseUrl = case baseUrl cfg of
+ [] -> "/"
+ url -> url
+ in
+ Link ref (linkBaseUrl </> inlinesToURL ref, "Go to wiki page")
convertWikiLinks _cfg (Link ref ("", "")) =
Link ref (inlinesToURL ref, "Go to wiki page")
convertWikiLinks _cfg x = x
Please sign in to comment.
Something went wrong with that request. Please try again.