We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9c15c05 commit cde1507Copy full SHA for cde1507
1 file changed
src/common/Util.res
@@ -26,6 +26,8 @@ module String = {
26
let leadingSlash = str => str->String.startsWith("/") ? str : "/" ++ str
27
28
let trailingSlash = str => str->String.endsWith("/") ? str : str ++ "/"
29
+
30
+ let removeTrailingSlash = str->String.replaceRegExp(/\/$/, "")
31
}
32
33
module Url = {
@@ -68,7 +70,7 @@ module Url = {
68
70
let splitUrl = str->Stdlib.String.split("#")
69
71
72
`${splitUrl[0]->Option.getOr("")}/${splitUrl[1]
- ->Option.map(anchor => "#" ++ anchor)
73
+ ->Option.map(anchor => "#" ++ anchor->String.removeTrailingSlash)
74
->Option.getOr("")}`
75
76
0 commit comments