以下测试在 JRE 1.6.0_20 中失败
public void testSetGetTextWithList() throws Exception {
final JEditorPane editorPane = new JEditorPane();
editorPane.setContentType("text/html");
editorPane.setText("<ul><li></li></ul>");
assertTrue(editorPane.getText().contains("<ul"));
}
当然,空列表和不存在的列表在视觉上是有区别的,所以我希望编辑器不要丢弃空列表。任何人都可以轻松解决这个问题?