Skip to content

Commit bb77d30

Browse files
author
Robert Jackson
authored
Skip block component conversion if the component has an `inverse… (#168)
Skip block component conversion if the component has an `inverse` block
2 parents f29dd77 + caa2902 commit bb77d30

2 files changed

Lines changed: 24 additions & 0 deletions

File tree

transforms/angle-brackets/test.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,3 +981,23 @@ test('handles link-to concat with hash', () => {
981981
"
982982
`);
983983
});
984+
985+
test('component-else', () => {
986+
let input = `
987+
{{#foo bar="baz"}}
988+
42
989+
{{else}}
990+
123
991+
{{/foo}}
992+
`;
993+
994+
expect(runTest('component-else.hbs', input)).toMatchInlineSnapshot(`
995+
"
996+
{{#foo bar=\\"baz\\"}}
997+
42
998+
{{else}}
999+
123
1000+
{{/foo}}
1001+
"
1002+
`);
1003+
});

transforms/angle-brackets/transform.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,10 @@ function transformToAngleBracket(env, fileInfo, config) {
340340
return;
341341
}
342342

343+
if (node.inverse) {
344+
return;
345+
}
346+
343347
const newTagName = transformTagName(tagName);
344348

345349
let attributes;

0 commit comments

Comments
 (0)