From ab853a866c40771e84a3235f40575efe04c435c5 Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Mon, 1 Mar 2021 12:01:41 +0100 Subject: Add explicit exceptions in markdown and allow for empty link destinations (#1757) --- .../ModuleAndPackageDocumentationParsingContext.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt') diff --git a/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt b/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt index afdcc43f..9122d8ee 100644 --- a/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt +++ b/plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt @@ -18,19 +18,19 @@ import org.jetbrains.kotlin.name.FqName import org.jetbrains.kotlin.name.Name fun interface ModuleAndPackageDocumentationParsingContext { - fun markdownParserFor(fragment: ModuleAndPackageDocumentationFragment): MarkdownParser + fun markdownParserFor(fragment: ModuleAndPackageDocumentationFragment, location: String): MarkdownParser } internal fun ModuleAndPackageDocumentationParsingContext.parse( fragment: ModuleAndPackageDocumentationFragment ): DocumentationNode { - return markdownParserFor(fragment).parse(fragment.documentation) + return markdownParserFor(fragment, fragment.source.sourceDescription).parse(fragment.documentation) } fun ModuleAndPackageDocumentationParsingContext( logger: DokkaLogger, facade: DokkaResolutionFacade? = null -) = ModuleAndPackageDocumentationParsingContext { fragment -> +) = ModuleAndPackageDocumentationParsingContext { fragment, sourceLocation -> val descriptor = when (fragment.classifier) { Module -> facade?.moduleDescriptor?.getPackage(FqName.topLevel(Name.identifier(""))) Package -> facade?.moduleDescriptor?.getPackage(FqName(fragment.name)) @@ -53,7 +53,7 @@ fun ModuleAndPackageDocumentationParsingContext( } } - MarkdownParser(externalDri = externalDri) + MarkdownParser(externalDri = externalDri, sourceLocation) } private fun Collection.sorted() = sortedWith( -- cgit