Browse Source

Formatting

ekardnam 4 năm trước cách đây
mục cha
commit
da0703b34c
1 tập tin đã thay đổi với 1 bổ sung4 xóa
  1. 1 4
      bot.js

+ 1 - 4
bot.js

@@ -129,10 +129,7 @@ let bot = {
   // makes a post formatted for twitter
   // mastodon returns posts in HTML
   twitterFormat: function(post) {
-    post = post.replace('<br/>', '\n') // new lines
-    post = post.replace('<p>', '')
-    post = post.replace('</p>', '\n')
-    return post
+    return post.replace(/<[^>]*>?/gm, '')
   },
 
   // poll on mastodon status updates