Skip to content

Commit

Permalink
Merge pull request #475 from esfomeado/master
Browse files Browse the repository at this point in the history
Preserve white spaces
  • Loading branch information
ochedru authored Sep 17, 2024
2 parents 4901b54 + 79707eb commit 3476af1
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 3476af1

Please sign in to comment.