From 920f22dec87d9312f0744008abf1d6b194598f1b Mon Sep 17 00:00:00 2001 From: Jeff Lockhart Date: Sat, 21 Dec 2024 22:52:11 -0700 Subject: [PATCH] Drop last additional newline character added when rewriting parsed HTML --- .../dokka/templates/DirectiveBasedTemplateProcessing.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/templates/DirectiveBasedTemplateProcessing.kt b/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/templates/DirectiveBasedTemplateProcessing.kt index d8ee2e780f..0e8e904d60 100644 --- a/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/templates/DirectiveBasedTemplateProcessing.kt +++ b/dokka-subprojects/plugin-templating/src/main/kotlin/org/jetbrains/dokka/templates/DirectiveBasedTemplateProcessing.kt @@ -41,7 +41,8 @@ public class DirectiveBasedHtmlTemplateProcessingStrategy(private val context: D handleCommandAsComment(command, bodyTrimed, input, output) } - Files.write(output.toPath(), listOf(document.outerHtml())) + // drop last additional \n character that's added + Files.write(output.toPath(), listOf(document.outerHtml().dropLast(1))) true } else false