diff options
author | vmishenev <vad-mishenev@yandex.ru> | 2021-10-15 12:38:18 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-15 12:38:18 +0300 |
commit | dc54ebd087124ee9035585ac64fa85c9b8957081 (patch) | |
tree | 9a87b8c85facd65824f12b23b53abef5db2ccce3 /plugins/base/src | |
parent | b2663070490d6ad31a0e7ba7ae80d16dbde43aef (diff) | |
download | dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.tar.gz dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.tar.bz2 dokka-dc54ebd087124ee9035585ac64fa85c9b8957081.zip |
Fix missed multiplatform tabs (#2178)
Diffstat (limited to 'plugins/base/src')
-rw-r--r-- | plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 27 | ||||
-rw-r--r-- | plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt | 2 |
2 files changed, 10 insertions, 19 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index 9a88de86..26560e4f 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -211,29 +211,20 @@ open class HtmlRenderer( ): List<Pair<DisplaySourceSet, String>> { var counter = 0 return nodes.toList().map { (sourceSet, elements) -> - sourceSet to createHTML(prettyPrint = false).prepareForTemplates().div { + val htmlContent = createHTML(prettyPrint = false).prepareForTemplates().div { elements.forEach { buildContentNode(it, pageContext, sourceSet.toSet()) } }.stripDiv() - }.groupBy( - Pair<DisplaySourceSet, String>::second, - Pair<DisplaySourceSet, String>::first - ).entries.flatMap { (html, sourceSets) -> - sourceSets.filterNot { sourceSet -> - sourceSet.sourceSetIDs.all.flatMap { sourceSetDependencyMap[it].orEmpty() } - .any { sourceSetId -> sourceSetId in sourceSets.sourceSetIDs } - }.map { - it to createHTML(prettyPrint = false).prepareForTemplates() - .div(classes = "content sourceset-depenent-content") { - if (counter++ == 0) attributes["data-active"] = "" - attributes["data-togglable"] = it.sourceSetIDs.merged.toString() - unsafe { - +html - } + sourceSet to createHTML(prettyPrint = false).prepareForTemplates() + .div(classes = "content sourceset-depenent-content") { + if (counter++ == 0) attributes["data-active"] = "" + attributes["data-togglable"] = sourceSet.sourceSetIDs.merged.toString() + unsafe { + +htmlContent } - } - } + } + }.sortedBy { it.first.sourceSetIDs.merged.let { it.scopeId + it.sourceSetName } } } override fun FlowContent.buildDivergent(node: ContentDivergentGroup, pageContext: ContentPage) { diff --git a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt index 8c78eff7..4592f6e6 100644 --- a/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt +++ b/plugins/base/src/test/kotlin/renderers/html/DivergentTest.kt @@ -126,7 +126,7 @@ class DivergentTest : HtmlRenderingOnlyTestBase() { } HtmlRenderer(context).render(page) - renderedContent.match(Div(Div(Div(Div("ae"), Div("bd"), Div("c"))))) + renderedContent.match(Div(Div(Div(Div("bd"), Div("c"), Div("ae"))))) } @Test |