diff options
| author | Andrzej Ratajczak <andrzej.ratajczak98@gmail.com> | 2020-08-25 11:47:50 +0200 |
|---|---|---|
| committer | Sebastian Sellmair <34319766+sellmair@users.noreply.github.com> | 2020-08-28 15:37:55 +0200 |
| commit | 0e38d64aa84a90668f6e0e4e346e447f2349aa54 (patch) | |
| tree | 103d57a5f861692cd0c58dd71f1c481de3b17e37 /plugins/base/src/main/kotlin/translators | |
| parent | de809e8076b3cde06dc29328298112ed4a7026b3 (diff) | |
| download | dokka-0e38d64aa84a90668f6e0e4e346e447f2349aa54.tar.gz dokka-0e38d64aa84a90668f6e0e4e346e447f2349aa54.tar.bz2 dokka-0e38d64aa84a90668f6e0e4e346e447f2349aa54.zip | |
Fix presentation of code blocks in dokka html and dokka javadoc formats
Diffstat (limited to 'plugins/base/src/main/kotlin/translators')
| -rw-r--r-- | plugins/base/src/main/kotlin/translators/psi/JavadocParser.kt | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/translators/psi/JavadocParser.kt b/plugins/base/src/main/kotlin/translators/psi/JavadocParser.kt index b9c328dc..5baaf35a 100644 --- a/plugins/base/src/main/kotlin/translators/psi/JavadocParser.kt +++ b/plugins/base/src/main/kotlin/translators/psi/JavadocParser.kt @@ -151,7 +151,8 @@ class JavadocParser( is PsiInlineDocTag -> convertInlineDocTag(this) is PsiDocParamRef -> toDocumentationLinkString() is PsiDocTagValue, - is LeafPsiElement -> text + is LeafPsiElement -> (if ((prevSibling as? PsiDocToken)?.isLeadingAsterisk() == true) text?.drop(1) else text) + ?.takeUnless { it.isBlank() } else -> null } @@ -214,7 +215,7 @@ class JavadocParser( } private fun convertHtmlNode(node: Node, insidePre: Boolean = false): DocTag? = when (node) { - is TextNode -> Text(body = if (insidePre) node.wholeText else node.text()) + is TextNode -> (if (insidePre) node.wholeText else node.text().takeIf { it.isNotBlank() })?.let { Text(body = it) } is Element -> createBlock(node) else -> null } |
