Skip to content

Commit 8e148f1

Browse files
EricWhiteDevclaude
andcommitted
Add mixed-content round-trip test for text with inline element
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 844c4ba commit 8e148f1

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

tests/RoundTrip.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ describe('Round-trip — Serialization', () => {
1717
expect(roundTrippedXml).toBe(originalXml);
1818
});
1919

20+
it('Mixed content with text and inline element', () => {
21+
const originalXml = `<root> Test <b>foo</b> More </root>`;
22+
const roundTrippedXml = XElement.parse(originalXml).toString();
23+
expect(roundTrippedXml).toBe(originalXml);
24+
});
25+
2026
it('Serialization with namespace and prefix', () => {
2127
const originalXml = `<w:root xmlns:w='urn:www' foo='bar'><w:child>hello</w:child></w:root>`;
2228
const roundTrippedXml = XElement.parse(originalXml).toString();

0 commit comments

Comments
 (0)