From b4df6de11f8f23e69e57db55f2e05b81466f6d1f Mon Sep 17 00:00:00 2001 From: Filip ZybaƂa Date: Thu, 9 Jul 2020 16:19:45 +0200 Subject: Bugfix: links in documentation attached to module page should now be correct --- plugins/base/src/main/kotlin/parsers/MarkdownParser.kt | 3 +++ .../documentables/ModuleAndPackageDocumentationTransformer.kt | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'plugins/base/src/main/kotlin') diff --git a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt index 6075ef73..36005d14 100644 --- a/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt +++ b/plugins/base/src/main/kotlin/parsers/MarkdownParser.kt @@ -124,6 +124,9 @@ class MarkdownParser( null } } + }.also { + if (it == null) + logger.warn("Couldn't resolve link for $mdLink") } private fun referenceLinksHandler(node: ASTNode): DocTag { diff --git a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt index a0800da8..4a98a5e0 100644 --- a/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt +++ b/plugins/base/src/main/kotlin/transformers/documentables/ModuleAndPackageDocumentationTransformer.kt @@ -8,6 +8,7 @@ import org.jetbrains.dokka.base.parsers.MarkdownParser import org.jetbrains.dokka.plugability.DokkaContext import org.jetbrains.dokka.transformers.documentation.PreMergeDocumentableTransformer import org.jetbrains.kotlin.name.FqName +import org.jetbrains.kotlin.name.Name import java.nio.file.Files import java.nio.file.Paths @@ -60,7 +61,7 @@ internal class ModuleAndPackageDocumentationTransformer( doc?.get("Module")?.get(module.name)?.run { pd to MarkdownParser( facade, - facade.moduleDescriptor, + facade.moduleDescriptor.getPackage(FqName.topLevel(Name.identifier(""))), context.logger ).parse(this) } -- cgit