Skip to content

Commit 6170e95

Browse files
committed
Trim only XML whitespace
Fixes #768
1 parent e9c5315 commit 6170e95

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/printer.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ function printCharDataIgnore(path) {
284284
return;
285285
}
286286

287-
const content = chardata.TEXT.trim();
287+
const content = chardata.TEXT.replaceAll(/^[\t\n\r\s]+|[\t\n\r\s]+$/g, "");
288288
const printed = group(
289289
content.split(/(\n)/g).map((value) => {
290290
if (value === "\n") {

0 commit comments

Comments
 (0)