aboutsummaryrefslogtreecommitdiff
path: root/plugins/base/src/main/kotlin/renderers
diff options
context:
space:
mode:
authorBłażej Kardyś <bkardys@virtuslab.com>2020-03-11 15:23:41 +0100
committerBłażej Kardyś <bkardys@virtuslab.com>2020-03-11 16:19:43 +0100
commitf48bffb05efcfd03cf72189ab13472c196f2a948 (patch)
tree79e10d919cf8485b37bff9c5ce4a753577e043c0 /plugins/base/src/main/kotlin/renderers
parent356be7009f857032f87bf0e5943cdef7f1438f65 (diff)
downloaddokka-f48bffb05efcfd03cf72189ab13472c196f2a948.tar.gz
dokka-f48bffb05efcfd03cf72189ab13472c196f2a948.tar.bz2
dokka-f48bffb05efcfd03cf72189ab13472c196f2a948.zip
Fixing signatures font, incorrect links and line breaking
Diffstat (limited to 'plugins/base/src/main/kotlin/renderers')
-rw-r--r--plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
index 2af547b8..a2a31340 100644
--- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
+++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt
@@ -27,11 +27,15 @@ open class HtmlRenderer(
node: ContentGroup,
pageContext: ContentPage,
childrenCallback: FlowContent.() -> Unit
- ) = when {
- node.dci.kind == ContentKind.BriefComment -> div("brief") { childrenCallback() }
- node.style.contains(TextStyle.Paragraph) -> p { childrenCallback() }
- node.style.contains(TextStyle.Block) -> div { childrenCallback() }
- else -> childrenCallback()
+ ) {
+ val additionalClasses = node.style.joinToString { it.toString().toLowerCase() }
+ return when {
+ node.dci.kind == ContentKind.BriefComment -> div("brief $additionalClasses") { childrenCallback() }
+ node.style.contains(TextStyle.Paragraph) -> p(additionalClasses) { childrenCallback() }
+ node.style.contains(TextStyle.Block) -> div(additionalClasses) { childrenCallback() }
+ additionalClasses.isNotBlank() -> span(additionalClasses) { childrenCallback() }
+ else -> childrenCallback()
+ }
}
override fun FlowContent.buildPlatformDependent(content: PlatformHintedContent, pageContext: ContentPage) {