diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java
index b5536e76482b..9b3edf22cc46 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ErrorPaneConfigurable.java
@@ -167,14 +167,15 @@ public class ErrorPaneConfigurable extends JPanel implements Configurable, Dispo
description = problemDescription.getDescription();
if (description == null) {
ProjectStructureElement place = problemDescription.getPlace().getContainingElement();
- description = place.getTypeName() + " " + place.getPresentableName() + ": " + problemDescription.getMessage(false);
+ description = place.getTypeName() + " " + XmlStringUtil.convertToHtmlContent(place.getPresentableName())
+ + ": " + XmlStringUtil.convertToHtmlContent(problemDescription.getMessage(false));
}
else {
- description = XmlStringUtil.stripHtml(description);
+ description = XmlStringUtil.convertToHtmlContent(description);
}
}
else {
- description = XmlStringUtil.stripHtml(error.getDescription());
+ description = XmlStringUtil.convertToHtmlContent(error.getDescription());
}
if (error.canBeFixed()) {
description += " [Fix]";
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
index 93bb55b8834d..53a6fff3afa6 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/LibraryProjectStructureElement.java
@@ -155,7 +155,7 @@ public class LibraryProjectStructureElement extends ProjectStructureElement {
final List fixes = Arrays.asList(new AddLibraryToDependenciesFix(), new RemoveLibraryFix(), new RemoveAllUnusedLibrariesFix());
final String name = StringUtil.escapeXml(myLibrary.getName());
String libraryName = "" + name + "";
- return new ProjectStructureProblemDescription("Library " + libraryName + " is not used", null, createPlace(),
+ return new ProjectStructureProblemDescription(XmlStringUtil.wrapInHtml("Library " + libraryName + " is not used"), null, createPlace(),
ProjectStructureProblemType.unused("unused-library"), ProjectStructureProblemDescription.ProblemLevel.PROJECT,
fixes, false);
}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ModuleProjectStructureElement.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ModuleProjectStructureElement.java
index d95f865b1d16..ed2010636e52 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ModuleProjectStructureElement.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ModuleProjectStructureElement.java
@@ -10,7 +10,6 @@ import com.intellij.openapi.roots.libraries.Library;
import com.intellij.openapi.roots.ui.configuration.ModuleEditor;
import com.intellij.openapi.roots.ui.configuration.ProjectStructureConfigurable;
import com.intellij.openapi.roots.ui.configuration.projectRoot.StructureConfigurableContext;
-import com.intellij.openapi.util.text.StringUtil;
import com.intellij.util.ArrayUtil;
import org.jetbrains.annotations.NotNull;
@@ -65,7 +64,7 @@ public class ModuleProjectStructureElement extends ProjectStructureElement {
}
}
else {
- problemsHolder.registerProblem(ProjectBundle.message("project.roots.library.problem.message", StringUtil.escapeXml(entry.getPresentableName())), null,
+ problemsHolder.registerProblem(ProjectBundle.message("project.roots.library.problem.message", entry.getPresentableName()), null,
ProjectStructureProblemType.error("invalid-module-dependency"), createPlace(entry),
null);
}
diff --git a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java
index f71939a1e2f5..11bdbd006d31 100644
--- a/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java
+++ b/java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/projectRoot/daemon/ProjectStructureProblemsHolderImpl.java
@@ -39,7 +39,7 @@ public class ProjectStructureProblemsHolderImpl implements ProjectStructureProbl
if (myProblemDescriptions != null) {
int problems = 0;
for (ProjectStructureProblemDescription problemDescription : myProblemDescriptions) {
- buf.append(XmlStringUtil.escapeString(problemDescription.getMessage(false))).append("
");
+ buf.append(XmlStringUtil.convertToHtmlContent(problemDescription.getMessage(false))).append("
");
problems++;
if (problems >= 10 && myProblemDescriptions.size() > 12) {
buf.append(myProblemDescriptions.size() - problems).append(" more problems...
");
diff --git a/platform/util/src/com/intellij/xml/util/XmlStringUtil.java b/platform/util/src/com/intellij/xml/util/XmlStringUtil.java
index 2fd987a772a5..07c8a405fef5 100644
--- a/platform/util/src/com/intellij/xml/util/XmlStringUtil.java
+++ b/platform/util/src/com/intellij/xml/util/XmlStringUtil.java
@@ -130,4 +130,13 @@ public class XmlStringUtil {
toolTip = StringUtil.trimEnd(toolTip, BODY_END);
return toolTip;
}
+
+ /**
+ * Converts {@code text} to a string which can be used inside an HTML document: if it's already an HTML text the root html/body tags will
+ * be stripped, if it's a plain text special characters will be escaped
+ */
+ @NotNull
+ public static String convertToHtmlContent(@NotNull String text) {
+ return isWrappedInHtml(text) ? stripHtml(text) : escapeString(text);
+ }
}
\ No newline at end of file