Skip to content

Commit 49ac55b

Browse files
committed
fix(text): clrf compatibility
1 parent b4308a9 commit 49ac55b

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

packages/text/src/text.lib.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,15 @@ Hello
124124
`Test\n Hello\n World\n %STR_EXTRA%{"type":"extra"}%!STR_EXTRA%`,
125125
);
126126
});
127+
128+
it("handles CRLF line endings in template values", () => {
129+
const multiline = "World\r\nUniverse";
130+
const text = Text.t`
131+
Hello
132+
${multiline}
133+
`;
134+
assert.equal(text, "Hello\n World\n Universe");
135+
});
127136
});
128137

129138
describe("split", () => {

packages/text/src/text.lib.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ export class Text {
9595
Text.EXTRA_OBJECT_SUFFIX
9696
}`;
9797
}
98-
return value;
98+
99+
return str(value).$;
99100
}
100101

101102
public static parse<E extends Text.ExtraObject.Base>(

0 commit comments

Comments
 (0)