diff options
author | Dominik Schürmann <dominik@schuermann.eu> | 2019-01-21 01:16:09 +0100 |
---|---|---|
committer | Simon Ogorodnik <Simon.Ogorodnik@jetbrains.com> | 2019-02-25 20:26:33 +0300 |
commit | f4aeac0a974837a18d0c18d42bd5980dffa043fb (patch) | |
tree | 8109f18ae406b242f4af53ab3ac66850437ef2b9 | |
parent | ff25593e8af941c624f3bee8bc031ae53c3700d5 (diff) | |
download | dokka-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.kt | 14 |
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 } |