Skip to content

Commit

Permalink
Fix excessive meta generator tags #3313
Browse files Browse the repository at this point in the history
  • Loading branch information
weyusi committed Oct 27, 2018
1 parent bbc2f04 commit 0853115
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugins/filter/meta_generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function hexoMetaGeneratorInject(data) {
if (!cheerio) cheerio = require('cheerio');
const $ = cheerio.load(data, {decodeEntities: false});

if (!($('meta[name="generator"]').length > 0)) {
if (!($('meta[name="generator"]').length > 0) && $('head').contents().length > 0) {
$('head').prepend(hexoGeneratorTag.replace('%s', this.version));

return $.html();
Expand Down

0 comments on commit 0853115

Please sign in to comment.