mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8225671: Support HTML 5 character references in javadoc
Reviewed-by: jjg
This commit is contained in:
parent
78f3c596a3
commit
3353016bbc
File diff suppressed because it is too large
Load Diff
@ -513,6 +513,7 @@ public class JavadocFormatter {
|
||||
public Object visitEntity(EntityTree node, Object p) {
|
||||
String name = node.getName().toString();
|
||||
int code = -1;
|
||||
String value = null;
|
||||
if (name.startsWith("#")) {
|
||||
try {
|
||||
int v = StringUtils.toLowerCase(name).startsWith("#x")
|
||||
@ -525,13 +526,12 @@ public class JavadocFormatter {
|
||||
//ignore
|
||||
}
|
||||
} else {
|
||||
Entity entity = Entity.get(name);
|
||||
if (entity != null) {
|
||||
code = entity.code;
|
||||
}
|
||||
value = Entity.getValue(name);
|
||||
}
|
||||
if (code != (-1)) {
|
||||
result.appendCodePoint(code);
|
||||
} else if (value != null) {
|
||||
result.append(value);
|
||||
} else {
|
||||
result.append(node.toString());
|
||||
}
|
||||
|
||||
@ -49,8 +49,6 @@ public class CoverageExtras {
|
||||
|
||||
check(Checker.Flag.TABLE_HAS_CAPTION, Checker.Flag.valueOf("TABLE_HAS_CAPTION"), Checker.Flag.values());
|
||||
|
||||
check(Entity.nbsp, Entity.valueOf("nbsp"), Entity.values());
|
||||
|
||||
check(Messages.Group.ACCESSIBILITY, Messages.Group.valueOf("ACCESSIBILITY"), Messages.Group.values());
|
||||
}
|
||||
|
||||
|
||||
@ -294,23 +294,35 @@ class EntitiesTest {
|
||||
* ‹ ‹
|
||||
* › ›
|
||||
* € €
|
||||
* / /
|
||||
* ⨂ ⨂
|
||||
* ℧ ࡏ
|
||||
* ― ―
|
||||
* ⌭ ⌭
|
||||
*/
|
||||
void symbolic_entities() { }
|
||||
|
||||
/**
|
||||
* ⌫
|
||||
*  
|
||||
*/
|
||||
void other_numeric() {}
|
||||
|
||||
/**
|
||||
* &bad;
|
||||
*/
|
||||
void bad_name() { }
|
||||
|
||||
/**
|
||||
* �
|
||||
*
|
||||
* 
|
||||
* ࡏ
|
||||
* �
|
||||
* �
|
||||
*/
|
||||
void out_of_range() { }
|
||||
|
||||
/**
|
||||
* ―
|
||||
* ⌫
|
||||
* 
|
||||
*/
|
||||
void sparse_negative() { }
|
||||
|
||||
@ -1,19 +1,22 @@
|
||||
EntitiesTest.java:301: error: invalid entity &bad;
|
||||
EntitiesTest.java:312: error: invalid entity &bad;
|
||||
* &bad;
|
||||
^
|
||||
EntitiesTest.java:306: error: invalid entity 
|
||||
EntitiesTest.java:317: error: invalid entity �
|
||||
* �
|
||||
^
|
||||
EntitiesTest.java:318: error: invalid entity
|
||||
*
|
||||
^
|
||||
EntitiesTest.java:319: error: invalid entity 
|
||||
* 
|
||||
^
|
||||
EntitiesTest.java:307: error: invalid entity ࡏ
|
||||
* ࡏ
|
||||
EntitiesTest.java:320: error: invalid entity �
|
||||
* �
|
||||
^
|
||||
EntitiesTest.java:312: error: invalid entity ―
|
||||
* ―
|
||||
EntitiesTest.java:321: error: invalid entity �
|
||||
* �
|
||||
^
|
||||
EntitiesTest.java:313: error: invalid entity ⌫
|
||||
* ⌫
|
||||
^
|
||||
EntitiesTest.java:314: error: invalid entity 
|
||||
EntitiesTest.java:326: error: invalid entity 
|
||||
* 
|
||||
^
|
||||
6 errors
|
||||
7 errors
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user