Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/plugins/system/meta/HTMLMetaHandler.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeHTML5 } from 'entities';
import { decodeHTMLStrict } from 'entities';
import * as url from 'url';
import * as utils from '../../../utils.js';
import { ldParser } from './ld-json.js';
Expand Down Expand Up @@ -57,7 +57,7 @@ HTMLMetaHandler.prototype.onopentag = function(name, attributes) {
if (tagName) {

if (/&[^;]+;/i.test(tagName)) {
tagName = decodeHTML5(tagName);
tagName = decodeHTMLStrict(tagName);
}
var propertyParts = tagName.split(/(?::|\.)/);

Expand Down Expand Up @@ -98,7 +98,7 @@ HTMLMetaHandler.prototype.onopentag = function(name, attributes) {
var refresh = metaTag.content && metaTag.content.match(/url=(?:'|")?([^'"]+)(?:'|")?/i);

if (refresh) {
this._refresh = decodeHTML5(refresh[1]);
this._refresh = decodeHTMLStrict(refresh[1]);
}

} else if (metaTag.name == "description") {
Expand Down Expand Up @@ -265,11 +265,11 @@ HTMLMetaHandler.prototype._finalMerge = function(tag) {
if (typeof(obj[k]) == 'string'){
// decode HTML entities after decoding the charset
// otherwise we would end up with a string with mixed encoding
obj[k] = decodeHTML5(encodeText(that._charset, obj[k]));
obj[k] = decodeHTMLStrict(encodeText(that._charset, obj[k]));

if (k === 'href') {
try {
// Process 'href' after decodeHTML5.
// Process 'href' after decodeHTMLStrict.
var href = obj[k];
href = href.replace(/(\r\n|\n|\r)/gm,"");
href = url.resolve(that._uri, href);
Expand Down
10 changes: 5 additions & 5 deletions plugins/domains/dailymail.com/dailymail.video.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeHTML5 } from 'entities';
import { decodeHTMLStrict } from 'entities';

export default {

Expand All @@ -13,15 +13,15 @@ export default {

if ($player.length == 1) {
return {
dailymailVideo: JSON.parse(decodeHTML5($player.attr('data-opts')))
dailymailVideo: JSON.parse(decodeHTMLStrict($player.attr('data-opts')))
}
}
},

getMeta: function(dailymailVideo, decode) {
return {
title: decodeHTML5(decode(dailymailVideo.title)),
description: decodeHTML5(decode(dailymailVideo.descr))
title: decodeHTMLStrict(decode(dailymailVideo.title)),
description: decodeHTMLStrict(decode(dailymailVideo.descr))
}
},

Expand All @@ -48,4 +48,4 @@ export default {
"https://www.dailymail.com/video/news/video-2895505/SVB-members-sets-bank-culture-apart-others.html",
"https://www.dailymail.com/video/news/video-3639123/Trump-says-expects-bomb-Iran-ceasefire-deal-ends.html",
]
};
};
4 changes: 2 additions & 2 deletions plugins/domains/google.com/docs.google.com.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeHTML5 } from 'entities';
import { decodeHTMLStrict } from 'entities';

export default {

Expand Down Expand Up @@ -132,7 +132,7 @@ export default {

var key = $el.attr('itemprop');
if (key) {
var value = decodeHTML5(decode($el.attr('content') || $el.attr('href')));
var value = decodeHTMLStrict(decode($el.attr('content') || $el.attr('href')));
result[key] = value;
}
});
Expand Down
4 changes: 2 additions & 2 deletions plugins/links/embedURL/embedURL.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeHTML5 } from 'entities';
import { decodeHTMLStrict } from 'entities';

export default {

Expand Down Expand Up @@ -55,7 +55,7 @@ export default {

var key = $el.attr('itemprop');
if (key) {
var value = decodeHTML5(decode($el.attr('content') || $el.attr('href')));
var value = decodeHTMLStrict(decode($el.attr('content') || $el.attr('href')));
result[key] = value;
}
});
Expand Down
4 changes: 2 additions & 2 deletions plugins/meta/description-from-p-tag.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decodeHTML5 } from 'entities';
import { decodeHTMLStrict } from 'entities';

export default {

Expand All @@ -11,7 +11,7 @@ export default {
cheerio("body p").each(function() {
var $p = cheerio(this);
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 someText = decodeHTMLStrict(decode($p.text()));
var requiredLimit = Number.isInteger(__allowPTagDescription) ? __allowPTagDescription : 64;
if (someText.length > requiredLimit) {
description = someText;
Expand Down
Loading