aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-07-02 11:33:52 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-07-08 11:48:29 +0200
commitf80d5938ccafcf5bd41d73f98bebe2d9699faa95 (patch)
tree8d0df46b4f806bdcc092c2f38af5face44e026bb /plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
parent5647b4221604a9084194949d9c582a57da920220 (diff)
downloaddokka-f80d5938ccafcf5bd41d73f98bebe2d9699faa95.tar.gz
dokka-f80d5938ccafcf5bd41d73f98bebe2d9699faa95.tar.bz2
dokka-f80d5938ccafcf5bd41d73f98bebe2d9699faa95.zip
Add GFM renderer tests
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt33
1 files changed, 14 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 a950667f..595dc8d2 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -222,26 +222,21 @@ open class HtmlRenderer(
}
override fun FlowContent.buildDivergent(node: ContentDivergentGroup, pageContext: ContentPage) {
+
val distinct =
- node.children.flatMap { instance ->
- instance.sourceSets.map { sourceSet ->
- Pair(instance, sourceSet) to Pair(
- createHTML(prettyPrint = false).div {
- instance.before?.let { before ->
- buildContentNode(before, pageContext, setOf(sourceSet))
- }
- }.stripDiv(),
- createHTML(prettyPrint = false).div {
- instance.after?.let { after ->
- buildContentNode(after, pageContext, setOf(sourceSet))
- }
- }.stripDiv()
- )
- }
- }.groupBy(
- Pair<Pair<ContentDivergentInstance, DokkaSourceSet>, Pair<String, String>>::second,
- Pair<Pair<ContentDivergentInstance, DokkaSourceSet>, Pair<String, String>>::first
- )
+ node.groupDivergentInstances(pageContext, { instance, contentPage, sourceSet ->
+ createHTML(prettyPrint = false).div {
+ instance.before?.let { before ->
+ buildContentNode(before, pageContext, setOf(sourceSet))
+ }
+ }.stripDiv()
+ }, { instance, contentPage, sourceSet ->
+ createHTML(prettyPrint = false).div {
+ instance.after?.let { after ->
+ buildContentNode(after, pageContext, setOf(sourceSet))
+ }
+ }.stripDiv()
+ })
distinct.forEach {
val groupedDivergent = it.value.groupBy { it.second }