Skip to content

Commit e8e626a

Browse files
committed
fix tumblr cheerio usage
1 parent 78a6a1b commit e8e626a

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

plugins/domains/tumblr.com/tumblr.photo.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ export default {
2626
tumblr_post.photos.forEach(function(photo) {
2727

2828
var title = photo.caption || tumblr_post.caption;
29-
// TODO: fix using cheerio
30-
title = cheerio('<div>').html(title).text();
29+
title = cheerio.load(title).text();
3130
if (title && title.length > 160) {
3231
title = title.split(/[.,!?]/)[0];
3332
}

plugins/domains/tumblr.com/tumblr.video.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,9 @@ export default {
2424

2525
var p = tumblr_post.player instanceof Array ? tumblr_post.player[0] : tumblr_post.player;
2626

27-
// TODO: fix using cheerio
28-
var $c = cheerio('<div>').append(p.embed_code);
29-
var $iframe = $c.find('iframe');
27+
var $iframe = cheerio.load(p.embed_code)('iframe');
3028

3129
if ($iframe.length) {
32-
3330
return {
3431
__promoUri: {
3532
url: $iframe.attr('src'),

0 commit comments

Comments
 (0)