Skip to content

Commit 8a4e977

Browse files
committed
Fix trim to match JSX behavior
1 parent 4fb17ab commit 8a4e977

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/index.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function build(input) {
5252

5353
function commit() {
5454
if (!inTag) {
55-
if (field || (buffer = buffer.trim())) {
55+
if (field || (buffer = buffer.replace(/^\s*\n+\s*|\s*\n+\s*$/g,''))) {
5656
if (hasChildren++) out += ',';
5757
out += field || JSON.stringify(buffer);
5858
}

0 commit comments

Comments
 (0)