diff options
author | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 03:09:13 +0400 |
---|---|---|
committer | Ilya Ryzhenkov <orangy@jetbrains.com> | 2014-07-12 03:09:13 +0400 |
commit | 1148622da477b48b25805d7bf0a7a3f56739bbe4 (patch) | |
tree | c893a3250a8ee0b551a8876f1fd97691488c4728 /src/Analysis/CommentsAPI.kt | |
parent | 5b24912e46d831434b8b4a12b0aedcf2b06c77e1 (diff) | |
download | dokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.tar.gz dokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.tar.bz2 dokka-1148622da477b48b25805d7bf0a7a3f56739bbe4.zip |
Simplify comment trimming.
Diffstat (limited to 'src/Analysis/CommentsAPI.kt')
-rw-r--r-- | src/Analysis/CommentsAPI.kt | 12 |
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 |