diff --git a/src/xlf/parser/__snapshots__/parser.test.ts.snap b/src/xlf/parser/__snapshots__/parser.test.ts.snap index 614657cc..2dd8982e 100644 --- a/src/xlf/parser/__snapshots__/parser.test.ts.snap +++ b/src/xlf/parser/__snapshots__/parser.test.ts.snap @@ -920,6 +920,60 @@ Array [ ] `; +exports[`parses translation units with and tags parses inline html wrapped in tags 1`] = ` +Array [ + Array [ + Object { + "data": "target", + "nodeType": "open", + "type": "tag", + }, + Object { + "data": "Sentence", + "type": "text", + }, + Object { + "data": "x", + "equivText": "
", + "nodeType": "self-closing", + "syntax": "html_inline", + "type": "tag", + }, + Object { + "data": "with ", + "type": "text", + }, + Object { + "data": "x", + "equivText": "", + "nodeType": "self-closing", + "syntax": "html_inline", + "type": "tag", + }, + Object { + "data": "html", + "type": "text", + }, + Object { + "data": "x", + "equivText": "", + "nodeType": "self-closing", + "syntax": "html_inline", + "type": "tag", + }, + Object { + "data": ".", + "type": "text", + }, + Object { + "data": "target", + "nodeType": "close", + "type": "tag", + }, + ], +] +`; + exports[`parses translation units with and tags parses links wrapped in and tags 1`] = ` Array [ Array [ diff --git a/src/xlf/parser/parser.test.ts b/src/xlf/parser/parser.test.ts index a7f06db2..07f7ab10 100644 --- a/src/xlf/parser/parser.test.ts +++ b/src/xlf/parser/parser.test.ts @@ -413,4 +413,17 @@ describe('parses translation units with and tags', () => { expect(translations.length).toStrictEqual(units.length); expect(translations).toMatchSnapshot(); }); + + it('parses inline html wrapped in tags', () => { + const units = [ + { + id: 1, + target: 'Sentencewith html.', + }, + ]; + const xlf = generateXLF(units); + const translations = parseTranslations({xlf}); + expect(translations.length).toStrictEqual(units.length); + expect(translations).toMatchSnapshot(); + }); });