diff --git a/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaDocumentationProvider.java b/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaDocumentationProvider.java index 92712e42e767..ed0188e86bd9 100644 --- a/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaDocumentationProvider.java +++ b/json/src/com/jetbrains/jsonSchema/impl/JsonBySchemaDocumentationProvider.java @@ -55,7 +55,7 @@ public class JsonBySchemaDocumentationProvider implements DocumentationProvider if (value instanceof JsonObject) { final JsonProperty description = ((JsonObject)value).findProperty("description"); if (description != null && description.getValue() instanceof JsonStringLiteral) { - return StringUtil.unquoteString(description.getValue().getText()); + return StringUtil.escapeXml(StringUtil.unquoteString(description.getValue().getText())); } } return null; diff --git a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaDocumentationTest.java b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaDocumentationTest.java index bb46321da1ef..b7f47cb68571 100644 --- a/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaDocumentationTest.java +++ b/json/tests/test/com/jetbrains/jsonSchema/JsonSchemaDocumentationTest.java @@ -28,4 +28,8 @@ public class JsonSchemaDocumentationTest extends JsonBySchemaDocumentationBaseTe public void testSecondLevel() throws Exception { doTest(true, "json"); } + + public void testCheckEscaping() throws Exception { + doTest(true, "json"); + } } diff --git a/json/tests/testData/jsonSchema/documentation/checkEscaping.html b/json/tests/testData/jsonSchema/documentation/checkEscaping.html new file mode 100644 index 000000000000..c73fc4ac3bd3 --- /dev/null +++ b/json/tests/testData/jsonSchema/documentation/checkEscaping.html @@ -0,0 +1 @@ +Disallows /// <reference path=> imports (use ES6-style imports instead) \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/checkEscaping.json b/json/tests/testData/jsonSchema/documentation/checkEscaping.json new file mode 100644 index 000000000000..4949d6933b92 --- /dev/null +++ b/json/tests/testData/jsonSchema/documentation/checkEscaping.json @@ -0,0 +1,3 @@ +{ + "no-reference": 1 +} \ No newline at end of file diff --git a/json/tests/testData/jsonSchema/documentation/checkEscapingSchema.json b/json/tests/testData/jsonSchema/documentation/checkEscapingSchema.json new file mode 100644 index 000000000000..84adf7e6bb6c --- /dev/null +++ b/json/tests/testData/jsonSchema/documentation/checkEscapingSchema.json @@ -0,0 +1,10 @@ +{ + "properties": { + "no-reference": { + "description": "Disallows /// imports (use ES6-style imports instead)" + }, + "my_property2": { + "description": "my property description 2" + } + } +} \ No newline at end of file