diff --git a/aio/transforms/examples-package/services/region-matchers/html.js b/aio/transforms/examples-package/services/region-matchers/html.js index 9305f2162f..4528c10750 100644 --- a/aio/transforms/examples-package/services/region-matchers/html.js +++ b/aio/transforms/examples-package/services/region-matchers/html.js @@ -1,7 +1,7 @@ // These kind of comments are used in HTML module.exports = { - regionStartMatcher: /^\s*\s*$/, - regionEndMatcher: /^\s*\s*$/, - plasterMatcher: /^\s*\s*$/, + regionStartMatcher: /^\s*)?\s*$/, + regionEndMatcher: /^\s*\s*$/, + plasterMatcher: /^\s*\s*$/, createPlasterComment: plaster => `` }; diff --git a/aio/transforms/examples-package/services/region-matchers/html.spec.js b/aio/transforms/examples-package/services/region-matchers/html.spec.js index 7a3cbf006b..9764b16a73 100644 --- a/aio/transforms/examples-package/services/region-matchers/html.spec.js +++ b/aio/transforms/examples-package/services/region-matchers/html.spec.js @@ -6,7 +6,7 @@ describe('html region-matcher', () => { matches = matcher.regionStartMatcher.exec(''); expect(matches).not.toBeNull(); - expect(matches[1]).toEqual('A b c '); + expect(matches[1]).toEqual('A b c'); matches = matcher.regionStartMatcher.exec(''); expect(matches).not.toBeNull(); @@ -22,7 +22,7 @@ describe('html region-matcher', () => { matches = matcher.regionEndMatcher.exec(''); expect(matches).not.toBeNull(); - expect(matches[1]).toEqual('A b c '); + expect(matches[1]).toEqual('A b c'); matches = matcher.regionEndMatcher.exec(''); expect(matches).not.toBeNull(); @@ -33,12 +33,20 @@ describe('html region-matcher', () => { expect(matches[1]).toEqual(''); }); + it('should handle annotations that do not close the comment on the same line', () => { + let matches; + + matches = matcher.regionStartMatcher.exec(''); expect(matches).not.toBeNull(); - expect(matches[1]).toEqual('A b c '); + expect(matches[1]).toEqual('A b c'); matches = matcher.plasterMatcher.exec(''); expect(matches).not.toBeNull();