Skip to content

Commit

Permalink
Remove duplicated rendering of top level description tags
Browse files Browse the repository at this point in the history
  • Loading branch information
IgnatBeresnev committed Dec 7, 2021
1 parent 349d841 commit 19b2a2d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 21 deletions.
2 changes: 0 additions & 2 deletions plugins/base/api/base.api
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,8 @@ public class org/jetbrains/dokka/base/renderers/html/HtmlRenderer : org/jetbrain
public static synthetic fun buildLink$default (Lorg/jetbrains/dokka/base/renderers/html/HtmlRenderer;Lkotlinx/html/FlowContent;Lorg/jetbrains/dokka/links/DRI;Ljava/util/List;Lorg/jetbrains/dokka/pages/PageNode;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)V
public synthetic fun buildList (Ljava/lang/Object;Lorg/jetbrains/dokka/pages/ContentList;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;)V
public fun buildList (Lkotlinx/html/FlowContent;Lorg/jetbrains/dokka/pages/ContentList;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;)V
public fun buildListItems (Lkotlinx/html/DL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;)V
public fun buildListItems (Lkotlinx/html/OL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;)V
public fun buildListItems (Lkotlinx/html/UL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;)V
public static synthetic fun buildListItems$default (Lorg/jetbrains/dokka/base/renderers/html/HtmlRenderer;Lkotlinx/html/DL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;ILjava/lang/Object;)V
public static synthetic fun buildListItems$default (Lorg/jetbrains/dokka/base/renderers/html/HtmlRenderer;Lkotlinx/html/OL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;ILjava/lang/Object;)V
public static synthetic fun buildListItems$default (Lorg/jetbrains/dokka/base/renderers/html/HtmlRenderer;Lkotlinx/html/UL;Ljava/util/List;Lorg/jetbrains/dokka/pages/ContentPage;Ljava/util/Set;ILjava/lang/Object;)V
public synthetic fun buildNavigation (Ljava/lang/Object;Lorg/jetbrains/dokka/pages/PageNode;)V
Expand Down
20 changes: 1 addition & 19 deletions plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -305,31 +305,13 @@ open class HtmlRenderer(
ol { buildListItems(node.children, pageContext, sourceSetRestriction) }
}
node.hasStyle(ListStyle.DescriptionList) -> {
dl { buildListItems(node.children, pageContext, sourceSetRestriction) }
dl { node.children.forEach { it.build(this, pageContext, sourceSetRestriction) } }
}
else -> {
ul { buildListItems(node.children, pageContext, sourceSetRestriction) }
}
}

open fun DL.buildListItems(
items: List<ContentNode>,
pageContext: ContentPage,
sourceSetRestriction: Set<DisplaySourceSet>? = null
) {
items.forEach {
when {
it.hasStyle(ListStyle.DescriptionTerm) -> dt {
it.build(this@buildListItems, pageContext, sourceSetRestriction)
}
it.hasStyle(ListStyle.DescriptionDetails) -> dd {
it.build(this@buildListItems, pageContext, sourceSetRestriction)
}
else -> it.build(this, pageContext, sourceSetRestriction)
}
}
}

open fun OL.buildListItems(
items: List<ContentNode>,
pageContext: ContentPage,
Expand Down

0 comments on commit 19b2a2d

Please sign in to comment.