aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:09:13 +0400
committerIlya Ryzhenkov <orangy@jetbrains.com>2014-07-12 03:09:13 +0400
commit1148622da477b48b25805d7bf0a7a3f56739bbe4 (patch)
treec893a3250a8ee0b551a8876f1fd97691488c4728
parent5b24912e46d831434b8b4a12b0aedcf2b06c77e1 (diff)
downloaddokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.tar.gz
dokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.tar.bz2
dokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.zip
Simplify comment trimming.
-rw-r--r--src/Analysis/CommentsAPI.kt12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/Analysis/CommentsAPI.kt b/src/Analysis/CommentsAPI.kt
index 03b1911c..6bdc3716 100644
--- a/src/Analysis/CommentsAPI.kt
+++ b/src/Analysis/CommentsAPI.kt
@@ -30,14 +30,10 @@ fun KDoc?.extractText(): String {
return ""
val lines = text.replace("\r", "").split("\n")
return lines.map {
- val comment = it.trim()
- .dropWhile { it == '/' }
- .dropWhile { it == '*' }
- .dropWhile { it == '/' }
- .trim()
- if (comment.endsWith("*/"))
- comment.substring(0, comment.length - 2).trim()
+ val comment = it.trim().dropWhile { it == '/' || it == '*'}
+ (if (comment.endsWith("*/"))
+ comment.substring(0, comment.length - 2)
else
- comment
+ comment).trim()
}.filter { it.any() }.join("\n")
} \ No newline at end of file