aboutsummaryrefslogtreecommitdiff
path: root/src/Locations/LocationService.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/Locations/LocationService.kt')
-rw-r--r--src/Locations/LocationService.kt6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Locations/LocationService.kt b/src/Locations/LocationService.kt
index cb0a5670..26a67382 100644
--- a/src/Locations/LocationService.kt
+++ b/src/Locations/LocationService.kt
@@ -32,7 +32,11 @@ public trait LocationService {
}
-public fun escapeUri(path: String): String = path.replace('<', '-').replace('>', '-')
+public fun identifierToFilename(path: String): String {
+ val escaped = path.replace('<', '-').replace('>', '-')
+ val lowercase = escaped.replaceAll("[A-Z]") { matchResult -> "-" + matchResult.group().toLowerCase() }
+ return if (lowercase == "index") "--index--" else lowercase
+}
/**
* Returns relative location between two nodes. Used for relative links in documentation.