Skip to content

Commit

Permalink
test(xlf/renderer/xlf-md): code syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
moki committed Oct 17, 2023
1 parent 16a4187 commit f3ce19a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders xlf to markdown renders code wrapped in <x> tag 1`] = `"Предложение номер \`один\`."`;
exports[`renders xlf to markdown renders em wrapped in <g> tags 1`] = `"Предложение номер *один*."`;
exports[`renders xlf to markdown renders plain text 1`] = `"Sentence about something. Another sentence."`;
Expand Down
20 changes: 20 additions & 0 deletions src/xlf/renderer/xlf-md/renderer-inline.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,24 @@ describe('renders xlf to markdown', () => {
const rendered = renderer.render(tokens);
expect(rendered).toMatchSnapshot();
});

it('renders code wrapped in <x> tag', () => {
const renderer = new XLFMDRenderer();
const tokens: Array<XLFToken> = [
{type: 'tag', data: 'target', nodeType: 'open'},
{type: 'text', data: 'Предложение номер '},
{
type: 'tag',
data: 'x',
nodeType: 'open',
syntax: 'code',
equivText: '`один`',
},
{type: 'text', data: '.'},
{type: 'tag', data: 'target', nodeType: 'close'},
];

const rendered = renderer.render(tokens);
expect(rendered).toMatchSnapshot();
});
});

0 comments on commit f3ce19a

Please sign in to comment.