WEB-25894 TSLint config: documentation text for no-reference is shown incorrectly

json schema: escape description text so that html symbols be shown correctly in documentation text
This commit is contained in:
irengrig
2017-03-13 12:28:24 +01:00
parent 5c03122475
commit 60338e72a7
5 changed files with 19 additions and 1 deletions
@@ -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;
@@ -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");
}
}
@@ -0,0 +1 @@
Disallows /// <reference path=> imports (use ES6-style imports instead)
@@ -0,0 +1,3 @@
{
"<caret>no-reference": 1
}
@@ -0,0 +1,10 @@
{
"properties": {
"no-reference": {
"description": "Disallows /// <reference path=> imports (use ES6-style imports instead)"
},
"my_property2": {
"description": "my property description 2"
}
}
}