fix: fix bug introduced in #2796 (#2803)

This commit is contained in:
Kid
2019-08-09 11:28:33 +08:00
committed by DIYgod
parent 054d159e8c
commit ae57b3bb89

View File

@@ -27,7 +27,7 @@ const ProcessFeed = ({ data = [] }, showAuthor = false) => {
}
};
const formatText = (text, br) => text.replace(/https:\/\/t\.co(.*)/g, '').replace(/\n/g, br);
const formatText = (text, br = '<br>') => text.replace(/https:\/\/t\.co(.*)/g, '').replace(/\n/g, br);
const formatVideo = (media) => {
let content = '';
const video = media.video_info.variants.reduce((video, item) => {
@@ -103,7 +103,7 @@ const ProcessFeed = ({ data = [] }, showAuthor = false) => {
title: `${showAuthor ? item.user.name + ': ' : ''}${item.in_reply_to_screen_name ? 'Re ' : ''}${formatText(item.full_text, '')}`,
description: `${showAuthor ? `<img width="15px" referrerpolicy="no-referrer" src="${item.user.profile_image_url_https}"><strong>${item.user.name}:</strong><br><br>` : ''}${
item.in_reply_to_screen_name ? 'Re ' : ''
}${formatText(item.full_text, '<br>')}${url}${img}${quote}`,
}${formatText(item.full_text)}${url}${img}${quote}`,
pubDate: new Date(item.created_at).toUTCString(),
link: `https://twitter.com/${item.user.screen_name}/status/${item.id_str}`,
};