diff --git a/packages/cli/src/api/parsers/angularHTML.js b/packages/cli/src/api/parsers/angularHTML.js index 0edf32d5..9e87170f 100644 --- a/packages/cli/src/api/parsers/angularHTML.js +++ b/packages/cli/src/api/parsers/angularHTML.js @@ -150,7 +150,7 @@ function parseHTMLTemplateFile(HASHES, filename, relativeFile, options) { } const data = fs.readFileSync(filename, 'utf8'); - const { rootNodes, errors } = ngHtmlParser.parse(data); + const { rootNodes, errors } = ngHtmlParser.parse(data, { canSelfClose: true }); if (errors.length) return; parseTemplateNode(rootNodes); diff --git a/packages/cli/test/api/extract.hashedkeys.test.js b/packages/cli/test/api/extract.hashedkeys.test.js index f9ffb9d6..4e490ea2 100644 --- a/packages/cli/test/api/extract.hashedkeys.test.js +++ b/packages/cli/test/api/extract.hashedkeys.test.js @@ -443,6 +443,16 @@ describe('extractPhrases with hashed keys', () => { }, string: '{var4}', }, + 'text.inside-self-closing-tag': { + meta: { + context: [], + occurrences: [ + 'angular-template.html', + ], + tags: [], + }, + string: 'This is some text inside a self-closing tag', + }, }); }); diff --git a/packages/cli/test/api/extract.sourcekeys.test.js b/packages/cli/test/api/extract.sourcekeys.test.js index 7c298453..c17c6c22 100644 --- a/packages/cli/test/api/extract.sourcekeys.test.js +++ b/packages/cli/test/api/extract.sourcekeys.test.js @@ -424,6 +424,16 @@ describe('extractPhrases with source keys', () => { }, string: '{var4}', }, + 'text.inside-self-closing-tag': { + meta: { + context: [], + occurrences: [ + 'angular-template.html', + ], + tags: [], + }, + string: 'This is some text inside a self-closing tag', + }, }); }); diff --git a/packages/cli/test/fixtures/angular-template.html b/packages/cli/test/fixtures/angular-template.html index 2082fdfa..76215b9e 100644 --- a/packages/cli/test/fixtures/angular-template.html +++ b/packages/cli/test/fixtures/angular-template.html @@ -98,4 +98,6 @@

> Content 1 + +