From fcd4d6588d3343a837a5d762365082965d6ac364 Mon Sep 17 00:00:00 2001
From: chylex <contact@chylex.com>
Date: Sun, 17 Mar 2024 02:06:11 +0100
Subject: [PATCH] Revert "Strip HTML from inspection description"

This reverts commit e6be154f

Inspection description is not supposed to contain HTML, and IntelliJ itself does not render HTML in the Problems tool window. Issues with HTML in inspection descriptions should be reported to wherever those inspections are coming from.

Stripping HTML breaks any properly formatted inspections that include anything that looks like an HTML tag, so I'm reverting it.

I might remove unescaping HTML entities later, but I'm not currently aware of it breaking anything, so it can stay.
---
 .../chylex/intellij/inspectionlens/editor/LensRenderer.kt | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/com/chylex/intellij/inspectionlens/editor/LensRenderer.kt b/src/main/kotlin/com/chylex/intellij/inspectionlens/editor/LensRenderer.kt
index 16d1630..1f58467 100644
--- a/src/main/kotlin/com/chylex/intellij/inspectionlens/editor/LensRenderer.kt
+++ b/src/main/kotlin/com/chylex/intellij/inspectionlens/editor/LensRenderer.kt
@@ -39,13 +39,11 @@ class LensRenderer(info: HighlightInfo) : HintRenderer(null) {
 	
 	private companion object {
 		private fun getValidDescriptionText(text: String?): String {
-			return if (text.isNullOrBlank()) " " else addMissingPeriod(convertHtmlToText(text))
+			return if (text.isNullOrBlank()) " " else addMissingPeriod(unescapeHtmlEntities(text))
 		}
 		
-		private fun convertHtmlToText(potentialHtml: String): String {
-			return potentialHtml
-				.ifContains('<') { StringUtil.stripHtml(it, " ") }
-				.ifContains('&', StringUtil::unescapeXmlEntities)
+		private fun unescapeHtmlEntities(potentialHtml: String): String {
+			return potentialHtml.ifContains('&', StringUtil::unescapeXmlEntities)
 		}
 		
 		private fun addMissingPeriod(text: String): String {