Skip to content

Commit

Permalink
Preserve white spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
esfomeado committed Sep 9, 2024
1 parent c626616 commit 79707eb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void write(Writer w) throws IOException {
.map(Entry::getKey);
Iterator<String> it = sortedStrings.iterator();
while (it.hasNext()) {
w.append("<si><t>").appendEscaped(it.next()).append("</t></si>");
w.append("<si><t xml:space=\"preserve\">").appendEscaped(it.next()).append("</t></si>");
}
w.append("</sst>");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -775,5 +775,12 @@ void testColumnStyle() throws Exception {
});
}

@Test
void testForIssue450() throws Exception {
writeWorkbook(wb -> {
Worksheet worksheet1 = wb.newWorksheet("Sheet1");
worksheet1.value(1, 1, "spaces ");
});
}

}

0 comments on commit 79707eb

Please sign in to comment.