aboutsummaryrefslogtreecommitdiff
path: root/integration-tests/src/main/kotlin/org/jetbrains/dokka/it
diff options
context:
space:
mode:
authorsebastian.sellmair <sebastian.sellmair@jetbrains.com>2020-07-10 13:50:01 +0200
committerSebastian Sellmair <34319766+sellmair@users.noreply.github.com>2020-07-13 14:23:08 +0200
commite9b3fead277bdbf0aced2801812cd22c3b8fd625 (patch)
tree0be1b421373c095597599bc93cdbcee8492cb8b5 /integration-tests/src/main/kotlin/org/jetbrains/dokka/it
parente940349980c40f87309c9ae80593519952d9dd7f (diff)
downloaddokka-e9b3fead277bdbf0aced2801812cd22c3b8fd625.tar.gz
dokka-e9b3fead277bdbf0aced2801812cd22c3b8fd625.tar.bz2
dokka-e9b3fead277bdbf0aced2801812cd22c3b8fd625.zip
Fix first integration tests
Diffstat (limited to 'integration-tests/src/main/kotlin/org/jetbrains/dokka/it')
-rw-r--r--integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt12
1 files changed, 8 insertions, 4 deletions
diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
index 0a83045e..aeebe552 100644
--- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
+++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
@@ -45,13 +45,17 @@ abstract class AbstractIntegrationTest {
val fileText = file.readText()
val html = Jsoup.parse(fileText)
html.allElements.toList().forEach { element ->
- val href = element.attr("href") ?: return@forEach
-
- if (href.startsWith("#")) return@forEach
+ val href = (element.attr("href") ?: return@forEach)
if (href.startsWith("https")) return@forEach
if (href.startsWith("http")) return@forEach
- val targetFile = File(file.parent, href)
+ val hrefWithoutAnchors = if (href.contains("#")) {
+ val hrefSplits = href.split("#")
+ if (hrefSplits.count() != 2) return@forEach
+ hrefSplits.first()
+ } else href
+
+ val targetFile = File(file.parent, hrefWithoutAnchors)
if (targetFile.extension.isNotEmpty() && targetFile.extension !in fileExtensions) return@forEach
if (