From 4fbb10ae5d0902fe75e4fde2e7d0a56ec45eb63f Mon Sep 17 00:00:00 2001 From: Marcin Aman Date: Tue, 25 Aug 2020 15:01:12 +0200 Subject: Change regex construction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Paweł Marks --- .../main/kotlin/translators/documentables/briefFromContentNodes.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/base/src/main') 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): List { - val firstSentenceRegex = Regex("^((?:[^.?!]|[.!?](?!\\s))*[.!?])") + val firstSentenceRegex = """^((?:[^.?!]|[.!?](?!\s))*[.!?])""".toRegex() var sentenceFound = false fun lookthrough(node: ContentNode): ContentNode = @@ -23,4 +23,4 @@ fun briefFromContentNodes(description: List): List { return description.mapNotNull { if (!sentenceFound) lookthrough(it) else null } -} \ No newline at end of file +} -- cgit