mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-13 21:55:01 +07:00
escape initializer text for quick javadoc (IDEA-114911)
This commit is contained in:
@@ -605,9 +605,7 @@ public class JavaDocInfoGenerator {
|
||||
boolean trunc = index < text.length();
|
||||
if (trunc) {
|
||||
text = text.substring(0, index);
|
||||
text = StringUtil.replace(text, "<", "<");
|
||||
text = StringUtil.replace(text, ">", ">");
|
||||
buffer.append(text);
|
||||
buffer.append(StringUtil.escapeXml(text));
|
||||
buffer.append("...");
|
||||
}
|
||||
else {
|
||||
@@ -1876,12 +1874,12 @@ public class JavaDocInfoGenerator {
|
||||
|
||||
@Override
|
||||
public void visitLiteralExpression(PsiLiteralExpression expression) {
|
||||
myBuffer.append(expression.getText());
|
||||
myBuffer.append(StringUtil.escapeXml(expression.getText()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void visitReferenceExpression(PsiReferenceExpression expression) {
|
||||
myBuffer.append(expression.getText());
|
||||
myBuffer.append(StringUtil.escapeXml(expression.getText()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
<html><head> <style type="text/css"> #error { background-color: #eeeeee; margin-bottom: 10px; } p { margin: 5px 0; } </style></head><body><small><b><a href="psi_element://A"><code>A</code></a></b></small><PRE>public <a href="psi_element://java.lang.String"><code>String</code></a> <b>strings = "A<BLANK>B"</b></PRE></body></html>
|
||||
@@ -0,0 +1,3 @@
|
||||
class A {
|
||||
public String strings = "A<BLANK>B";
|
||||
}
|
||||
@@ -60,6 +60,10 @@ public class JavaDocInfoGeneratorTest extends CodeInsightTestCase {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
public void testInitializerWithLiteral() throws Exception {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
public void testInitializerWithReference() throws Exception {
|
||||
doTestField();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user