Skip to content

Commit

Permalink
test(xlf/renderer/md-xlf): abbreviations inside parenthesis
Browse files Browse the repository at this point in the history
  • Loading branch information
moki committed Dec 12, 2023
1 parent ba27991 commit 7e8a963
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/xlf/renderer/md-xlf/__snapshots__/renderer-inline.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,28 @@ exports[`renders xlf from markdown renders samp wrapped in <g> tags 1`] = `
"
`;
exports[`renders xlf from markdown renders sentences with abbreviations inside parenthesis 1`] = `
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>
<xliff xmlns=\\"urn:oasis:names:tc:xliff:document:1.2\\" version=\\"1.2\\">
<file original=\\"text.md\\" source-language=\\"ru-RU\\" target-language=\\"en-US\\" datatype=\\"markdown\\">
<header>
<skeleton>
<external-file href=\\"text.skl.md\\"></external-file>
</skeleton>
</header>
<body>
<trans-unit id=\\"1\\">
<source>Sentence (см. <g ctype=\\"x-link_text_part\\" equiv-text=\\"[]\\">link</g><g ctype=\\"x-link_attributes_part\\" equiv-text=\\"()\\"><x ctype=\\"x-link_attributes_href\\" equiv-text=\\"file.md\\" /></g>) continues.</source>
</trans-unit>
<trans-unit id=\\"2\\">
<source>Another sentence.</source>
</trans-unit>
</body>
</file>
</xliff>
"
`;
exports[`renders xlf from markdown renders strong wrapped in <g> tags 1`] = `
"<?xml version=\\"1.0\\" encoding=\\"UTF-8\\"?>
<xliff xmlns=\\"urn:oasis:names:tc:xliff:document:1.2\\" version=\\"1.2\\">
Expand Down
11 changes: 11 additions & 0 deletions src/xlf/renderer/md-xlf/renderer-inline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,15 @@ describe('renders xlf from markdown', () => {
const rendered = render(parameters);
expect(rendered).toMatchSnapshot();
});

it('renders sentences with abbreviations inside parenthesis', () => {
const parameters: RenderParameters = {
...baseRendererParameters,
markdown: `Sentence (см. [link](file.md)) continues. Another sentence.`,
};

const rendered = render(parameters);
expect(rendered).toMatchSnapshot();
console.log(rendered);

Check warning on line 267 in src/xlf/renderer/md-xlf/renderer-inline.test.ts

View workflow job for this annotation

GitHub Actions / node version: 18.* os: ubuntu-latest

Unexpected console statement

Check warning on line 267 in src/xlf/renderer/md-xlf/renderer-inline.test.ts

View workflow job for this annotation

GitHub Actions / node version: 18.* os: macos-latest

Unexpected console statement

Check warning on line 267 in src/xlf/renderer/md-xlf/renderer-inline.test.ts

View workflow job for this annotation

GitHub Actions / node version: 18.* os: windows-latest

Unexpected console statement
});
});

0 comments on commit 7e8a963

Please sign in to comment.