diff options
author | Ignat Beresnev <ignat.beresnev@jetbrains.com> | 2022-04-29 15:03:08 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-29 15:03:08 +0300 |
commit | 8c218ff4dd5f970233c43845c19299fc74256389 (patch) | |
tree | b6818183ce8faa2c58d6571ca1c86aa28d4f0431 /plugins/gfm/src/main/kotlin/org/jetbrains | |
parent | 84aacad29982240ae367b21e9d283d38dab672ae (diff) | |
download | dokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.gz dokka-8c218ff4dd5f970233c43845c19299fc74256389.tar.bz2 dokka-8c218ff4dd5f970233c43845c19299fc74256389.zip |
Enable warnings as errors and fix all warnings (#2451)
* Enable warnings as errors and fix all warnings
* Enable skip-metadata-version-check compiler setting
Diffstat (limited to 'plugins/gfm/src/main/kotlin/org/jetbrains')
-rw-r--r-- | plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt index 786e410d..13322944 100644 --- a/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt +++ b/plugins/gfm/src/main/kotlin/org/jetbrains/dokka/gfm/renderer/CommonmarkRenderer.kt @@ -99,15 +99,20 @@ open class CommonmarkRenderer( pageContext: ContentPage, sourceSetRestriction: Set<DisplaySourceSet>? ) { - locationProvider.resolve(node.address, node.sourceSets, pageContext)?.let { - buildLink(it) { + val location = locationProvider.resolve(node.address, node.sourceSets, pageContext) + if (location == null) { + if (isPartial) { + templateCommand(ResolveLinkGfmCommand(node.address)) { + buildText(node.children, pageContext, sourceSetRestriction) + } + } else { buildText(node.children, pageContext, sourceSetRestriction) } - } ?: if (isPartial) { - templateCommand(ResolveLinkGfmCommand(node.address)) { + } else { + buildLink(location) { buildText(node.children, pageContext, sourceSetRestriction) } - } else buildText(node.children, pageContext, sourceSetRestriction) + } } override fun StringBuilder.buildLineBreak() { @@ -253,11 +258,11 @@ open class CommonmarkRenderer( override fun StringBuilder.buildDivergent(node: ContentDivergentGroup, pageContext: ContentPage) { val distinct = - node.groupDivergentInstances(pageContext, { instance, contentPage, sourceSet -> + node.groupDivergentInstances(pageContext, { instance, _, sourceSet -> instance.before?.let { before -> buildString { buildContentNode(before, pageContext, sourceSet) } } ?: "" - }, { instance, contentPage, sourceSet -> + }, { instance, _, sourceSet -> instance.after?.let { after -> buildString { buildContentNode(after, pageContext, sourceSet) } } ?: "" |