poi-tl
poi-tl copied to clipboard
列表渲染时,如果表达式后紧跟文字结果不符合预期
Issue description
模板如下
结果如下
poi-tl version
all
Minimal test code to reproduce the issue
public static void main(String[] args) throws Exception {
TestData testData = new TestData();
testData.setList(new ArrayList<Item>());
for (int i = 0; i < 10; i++) {
Item item = new Item();
item.setName("name_" + i);
testData.getList().add(item);
}
XWPFTemplate template;
try (InputStream inputStream = Files.newInputStream(Paths.get("./template.docx"))) {
Configure config = Configure.builder()
.build();
template = XWPFTemplate.compile(inputStream, config).render(testData);
}
try (OutputStream os = Files.newOutputStream(Paths.get("./result.docx"))) {
template.writeAndClose(os);
}
}
public static class TestData {
private List<Item> list;
public List<Item> getList() {
return list;
}
public void setList(List<Item> list) {
this.list = list;
}
}
public static class Item {
private String name;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}