aboutsummaryrefslogtreecommitdiff
path: root/plugins/base
diff options
context:
space:
mode:
authorMarcin Aman <marcin.aman@gmail.com>2020-08-25 15:01:12 +0200
committerPaweł Marks <Kordyjan@users.noreply.github.com>2020-08-25 17:49:30 +0200
commit4fbb10ae5d0902fe75e4fde2e7d0a56ec45eb63f (patch)
treeb9370246e0226e1a99097be60b04f6907fe9527f /plugins/base
parentc9af371aa18dc50490dc3927ed88dfe8836c1bde (diff)
downloaddokka-4fbb10ae5d0902fe75e4fde2e7d0a56ec45eb63f.tar.gz
dokka-4fbb10ae5d0902fe75e4fde2e7d0a56ec45eb63f.tar.bz2
dokka-4fbb10ae5d0902fe75e4fde2e7d0a56ec45eb63f.zip
Change regex construction
Co-authored-by: Paweł Marks <Kordyjan@users.noreply.github.com>
Diffstat (limited to 'plugins/base')
-rw-r--r--plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
index 9fe128dd..ca66c1a8 100644
--- a/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
+++ b/plugins/base/src/main/kotlin/translators/documentables/briefFromContentNodes.kt
@@ -6,7 +6,7 @@ import org.jetbrains.dokka.pages.ContentText
import org.jetbrains.dokka.pages.TextStyle
fun briefFromContentNodes(description: List<ContentNode>): List<ContentNode> {
- val firstSentenceRegex = Regex("^((?:[^.?!]|[.!?](?!\\s))*[.!?])")
+ val firstSentenceRegex = """^((?:[^.?!]|[.!?](?!\s))*[.!?])""".toRegex()
var sentenceFound = false
fun lookthrough(node: ContentNode): ContentNode =
@@ -23,4 +23,4 @@ fun briefFromContentNodes(description: List<ContentNode>): List<ContentNode> {
return description.mapNotNull {
if (!sentenceFound) lookthrough(it) else null
}
-} \ No newline at end of file
+}