diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-09 20:12:30 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-09 20:12:30 +0100 |
commit | 0b6f2b22f972b8e62f1d5eece72aea93043ffb90 (patch) | |
tree | ac68446902945aaf98988c8c5ccc97d8b6ade7fb /src/Locations/LocationService.kt | |
parent | e9c1e35d583c78bf74d18ee8ae9389cd37a9f554 (diff) | |
download | dokka-0b6f2b22f972b8e62f1d5eece72aea93043ffb90.tar.gz dokka-0b6f2b22f972b8e62f1d5eece72aea93043ffb90.tar.bz2 dokka-0b6f2b22f972b8e62f1d5eece72aea93043ffb90.zip |
make sure that file names generated from identifiers are unique on case-insensitive file systems
Diffstat (limited to 'src/Locations/LocationService.kt')
-rw-r--r-- | src/Locations/LocationService.kt | 6 |
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. |