diff --git a/lib/routes/twitter/utils.js b/lib/routes/twitter/utils.js
index d4bdf17173..6a83d60e02 100644
--- a/lib/routes/twitter/utils.js
+++ b/lib/routes/twitter/utils.js
@@ -27,7 +27,7 @@ const ProcessFeed = ({ data = [] }, showAuthor = false) => {
}
};
- const formatText = (text) => text.replace(/https:\/\/t\.co(.*)/g, '').replace(/\n/g, '
');
+ const formatText = (text, 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) => {
@@ -71,7 +71,7 @@ const ProcessFeed = ({ data = [] }, showAuthor = false) => {
const formatUrl = (item) => {
let url = '';
item.entities.urls.forEach((u) => {
- url += `${u.expanded_url}`;
+ url += `${u.expanded_url}`;
});
return url;
@@ -100,10 +100,10 @@ const ProcessFeed = ({ data = [] }, showAuthor = false) => {
}
return {
- title: `${showAuthor ? item.user.name + ': ' : ''}${item.in_reply_to_screen_name ? 'Re ' : ''}${formatText(item.full_text)}`,
+ title: `${showAuthor ? item.user.name + ': ' : ''}${item.in_reply_to_screen_name ? 'Re ' : ''}${formatText(item.full_text, '')}`,
description: `${showAuthor ? `
${item.user.name}:
` : ''}${
item.in_reply_to_screen_name ? 'Re ' : ''
- }${formatText(item.full_text)}${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}`,
};