diff --git a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/DescriptionEditorPane.kt b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/DescriptionEditorPane.kt index bc0e99c91bd9..20416f0b7532 100644 --- a/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/DescriptionEditorPane.kt +++ b/platform/lang-impl/src/com/intellij/profile/codeInspection/ui/DescriptionEditorPane.kt @@ -1,4 +1,4 @@ -// Copyright 2000-2021 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. +// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. package com.intellij.profile.codeInspection.ui import com.intellij.lang.Language @@ -67,7 +67,13 @@ fun JEditorPane.readHTML(text: @Nls String) { */ fun JEditorPane.readHTMLWithCodeHighlighting(text: String, language: String?) { var lang = Language.findLanguageByID(language) ?: PlainTextLanguage.INSTANCE - val document = Jsoup.parse(text) + + // IJPL-180212 + @Suppress("HardCodedStringLiteral") + val normalizedText = Regex("\\s*") + .replace(text, "") + + val document = Jsoup.parse(normalizedText) // IDEA-318323 if (text.contains("
\n")) { @@ -84,7 +90,6 @@ fun JEditorPane.readHTMLWithCodeHighlighting(text: String, language: String?) { } try { - @Suppress("HardCodedStringLiteral") setText(document.html()) } catch (e: IOException) {