소스 검색

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