Skip to content

Commit

Permalink
meta: clean up noise from p-tag descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
iparamonau committed Sep 19, 2024
1 parent 559df2a commit 9236478
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/meta/description-from-p-tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default {
var description;
cheerio("body p").each(function() {
var $p = cheerio(this);
if ($p.children("label, input, button, div").length === 0 && !$p.parents("noscript, header,#header,[role='banner']").length) {
if ($p.children("label, input, button, div, script, span").length === 0 && !$p.parents("noscript, header,#header,[role='banner']").length) {
var someText = decodeHTML5(decode($p.text()));
var requiredLimit = Number.isInteger(__allowPTagDescription) ? __allowPTagDescription : 64;
if (someText.length > requiredLimit) {
Expand Down

0 comments on commit 9236478

Please sign in to comment.