diff options
author | Marcin Aman <marcin.aman@gmail.com> | 2021-03-01 12:01:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-01 12:01:41 +0100 |
commit | ab853a866c40771e84a3235f40575efe04c435c5 (patch) | |
tree | 81f4df0d5ead3bac649f9ac61a04864ebcb57c44 /plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt | |
parent | ce962389afe86c0d54a08df942e564a077b25c3f (diff) | |
download | dokka-ab853a866c40771e84a3235f40575efe04c435c5.tar.gz dokka-ab853a866c40771e84a3235f40575efe04c435c5.tar.bz2 dokka-ab853a866c40771e84a3235f40575efe04c435c5.zip |
Add explicit exceptions in markdown and allow for empty link destinations (#1757)
Diffstat (limited to 'plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt')
-rw-r--r-- | plugins/base/src/main/kotlin/parsers/moduleAndPackage/ModuleAndPackageDocumentationParsingContext.kt | 8 |
1 files changed, 4 insertions, 4 deletions
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<DeclarationDescriptor>.sorted() = sortedWith( |