diff --git a/lib/plugins/filter/after_render/meta_generator.js b/lib/plugins/filter/after_render/meta_generator.js index 0a4addcc46..516cdbba59 100644 --- a/lib/plugins/filter/after_render/meta_generator.js +++ b/lib/plugins/filter/after_render/meta_generator.js @@ -3,7 +3,7 @@ function hexoMetaGeneratorInject(data) { const { config } = this; if (!config.meta_generator - || data.match(/]+[\s]+)name=['|"]?generator['|"]?/i)) return; const hexoGeneratorTag = ``; diff --git a/test/scripts/filters/meta_generator.js b/test/scripts/filters/meta_generator.js index 1acc426420..6703bf0f55 100644 --- a/test/scripts/filters/meta_generator.js +++ b/test/scripts/filters/meta_generator.js @@ -25,13 +25,11 @@ describe('Meta Generator', () => { }); it('no duplicate generator tag', () => { - const content = '' - + ''; hexo.config.meta_generator = true; - const result = metaGenerator(content); + const resultType = str => typeof metaGenerator(str); - const resultType = typeof result; - resultType.should.eql('undefined'); + resultType('').should.eql('undefined'); + resultType('').should.eql('undefined'); }); it('ignore empty head tag', () => {