From b64f5e5ac409243dbf2e7abf4e71162da9a331a4 Mon Sep 17 00:00:00 2001 From: "yana.hrynevich" Date: Fri, 6 Feb 2026 14:01:24 +0100 Subject: [PATCH] IJPL-220746 Extract HTML_TAGS_REGEX to constant in CorpusBuilder GitOrigin-RevId: 4a1c35d65fbd5298722a8d8660ed80240e758af0 --- .../intellij/searchEverywhereMl/typos/models/CorpusBuilder.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/search-everywhere-ml/typos/src/com/intellij/searchEverywhereMl/typos/models/CorpusBuilder.kt b/plugins/search-everywhere-ml/typos/src/com/intellij/searchEverywhereMl/typos/models/CorpusBuilder.kt index 93d21f681cc4..51c089eee834 100644 --- a/plugins/search-everywhere-ml/typos/src/com/intellij/searchEverywhereMl/typos/models/CorpusBuilder.kt +++ b/plugins/search-everywhere-ml/typos/src/com/intellij/searchEverywhereMl/typos/models/CorpusBuilder.kt @@ -123,7 +123,7 @@ internal class CorpusBuilder(coroutineScope: CoroutineScope) { if (configurable is ConfigurableWrapper) { configurable.extensionPoint.pluginDescriptor.description - ?.replace(Regex("<[^>]*>"), "") // matches everything enclosed in < and > and removes any HTML-like tags. + ?.replace(HTML_TAGS_REGEX, "") // matches everything enclosed in < and > and removes any HTML-like tags. ?.split('.', '\n') ?.mapNotNull { tokenizeText(it) } ?.let { collectedTokens.addAll(it) } @@ -139,6 +139,7 @@ internal class CorpusBuilder(coroutineScope: CoroutineScope) { } private val alphabeticPattern = Pattern.compile("^[a-zA-Z]+$") + private val HTML_TAGS_REGEX = Regex("<[^>]*>") private fun tokenizeText(text: String): List? = splitText(text)