aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Locations
diff options
context:
space:
mode:
authorEugene Petrenko <eugene.petrenko@jetbrains.com>2018-09-13 23:30:41 +0300
committerEugene Petrenko <eugene.petrenko@jetbrains.com>2018-09-13 23:30:41 +0300
commit9521c1100eb8c6c09d71352ba49eca66c7612a55 (patch)
tree359358fbd25616f9f6f2979a824235a831432db9 /core/src/main/kotlin/Locations
parent9379b68427bcfb44caa3ced02cb1c34789869e41 (diff)
downloaddokka-9521c1100eb8c6c09d71352ba49eca66c7612a55.tar.gz
dokka-9521c1100eb8c6c09d71352ba49eca66c7612a55.tar.bz2
dokka-9521c1100eb8c6c09d71352ba49eca66c7612a55.zip
avoid clash for empty-named symbols
Diffstat (limited to 'core/src/main/kotlin/Locations')
-rw-r--r--core/src/main/kotlin/Locations/Location.kt1
1 files changed, 1 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Locations/Location.kt b/core/src/main/kotlin/Locations/Location.kt
index 4cb0ac39..4448fb99 100644
--- a/core/src/main/kotlin/Locations/Location.kt
+++ b/core/src/main/kotlin/Locations/Location.kt
@@ -44,6 +44,7 @@ fun relativePathToNode(qualifiedName: List<String>, hasMembers: Boolean): String
fun relativePathToNode(node: DocumentationNode) = relativePathToNode(node.path.map { it.name }, node.members.any())
fun identifierToFilename(path: String): String {
+ if (path.isEmpty()) return "--root--"
val escaped = path.replace('<', '-').replace('>', '-')
val lowercase = escaped.replace("[A-Z]".toRegex()) { matchResult -> "-" + matchResult.value.toLowerCase() }
return if (lowercase == "index") "--index--" else lowercase