aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Schürmann <dominik@schuermann.eu>2019-01-21 01:16:09 +0100
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2019-02-25 20:26:33 +0300
commitf4aeac0a974837a18d0c18d42bd5980dffa043fb (patch)
tree8109f18ae406b242f4af53ab3ac66850437ef2b9
parentff25593e8af941c624f3bee8bc031ae53c3700d5 (diff)
downloaddokka-f4aeac0a974837a18d0c18d42bd5980dffa043fb.tar.gz
dokka-f4aeac0a974837a18d0c18d42bd5980dffa043fb.tar.bz2
dokka-f4aeac0a974837a18d0c18d42bd5980dffa043fb.zip
Preserve newlines in javadoc code blocks
-rw-r--r--core/src/main/kotlin/Java/JavadocParser.kt14
1 files changed, 9 insertions, 5 deletions
diff --git a/core/src/main/kotlin/Java/JavadocParser.kt b/core/src/main/kotlin/Java/JavadocParser.kt
index d6e46c50..3411b5c7 100644
--- a/core/src/main/kotlin/Java/JavadocParser.kt
+++ b/core/src/main/kotlin/Java/JavadocParser.kt
@@ -160,13 +160,17 @@ class JavadocParser(
return ContentText(node.text())
} else if (node is Element) {
val childBlock = createBlock(node)
- node.childNodes().forEach {
- val child = convertHtmlNode(it)
- if (child != null) {
- childBlock.append(child)
+ if (childBlock is ContentBlockCode) {
+ childBlock.append(ContentText(node.text()))
+ } else {
+ node.childNodes().forEach {
+ val child = convertHtmlNode(it)
+ if (child != null) {
+ childBlock.append(child)
+ }
}
+ return (childBlock)
}
- return (childBlock)
}
return null
}