diff --git a/lib/routes/twitter/utils.js b/lib/routes/twitter/utils.js index f7a1b3882..b97cf990d 100644 --- a/lib/routes/twitter/utils.js +++ b/lib/routes/twitter/utils.js @@ -25,7 +25,7 @@ const ProcessFeed = ({ data = [] }) => { } }; - const formatText = (text) => text.replace(/https:\/\/t\.co(.*)/g, ''); + const formatText = (text) => text.replace(/https:\/\/t\.co(.*)/g, '').replace(/\n/g, '
'); const formatVideo = (media) => { let content = ''; const video = media.video_info.variants.reduce((video, item) => { @@ -97,8 +97,8 @@ const ProcessFeed = ({ data = [] }) => { } return { - title: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.full_text}`, - description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${item.full_text}${url}${img}${quote}`, + title: `${item.in_reply_to_screen_name ? 'Re ' : ''}${formatText(item.full_text)}`, + description: `${item.in_reply_to_screen_name ? 'Re ' : ''}${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}`, };