From 9521c1100eb8c6c09d71352ba49eca66c7612a55 Mon Sep 17 00:00:00 2001 From: Eugene Petrenko Date: Thu, 13 Sep 2018 23:30:41 +0300 Subject: avoid clash for empty-named symbols --- core/src/main/kotlin/Locations/Location.kt | 1 + 1 file changed, 1 insertion(+) (limited to 'core/src') 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, 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 -- cgit