From 5636115aee8d13870f0d3f172667fca1b3f78276 Mon Sep 17 00:00:00 2001 From: Błażej Kardyś Date: Wed, 11 Mar 2020 13:05:14 +0100 Subject: Classlike header and other ui fixes --- .../base/src/main/kotlin/renderers/html/HtmlRenderer.kt | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt') diff --git a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt index aaa9c0a4..390730a3 100644 --- a/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt +++ b/plugins/base/src/main/kotlin/renderers/html/HtmlRenderer.kt @@ -172,10 +172,16 @@ open class HtmlRenderer( language: String, pageContext: ContentPage ) { - buildNewLine() - code.forEach { - +((it as? ContentText)?.text ?: run { context.logger.error("Cannot cast $it as ContentText!"); "" }) - buildNewLine() + span(classes = "code") { + val iterator = code.iterator() + while (iterator.hasNext()) { + val element = iterator.next() + +((element as? ContentText)?.text + ?: run { context.logger.error("Cannot cast $element as ContentText!"); "" }) + if (iterator.hasNext()) { + buildNewLine() + } + } } } -- cgit