瀏覽代碼

Formatting

ekardnam 4 年之前
父節點
當前提交
da0703b34c
共有 1 個文件被更改,包括 1 次插入4 次删除
  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