Skip to content

Commit

Permalink
Fix excessive meta generator tags hexojs#3313
Browse files Browse the repository at this point in the history
  • Loading branch information
weyusi authored and Thomas Parisot committed Jan 17, 2020
1 parent 0cd7d50 commit fb551f0
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 fb551f0

Please sign in to comment.