@@ -5,7 +5,7 @@ const weiboUtils = {
55 formatWithRetweet : ( status , showAuthorAvatar = true ) => {
66 let retweetedOrOriginal = '' ;
77 // 长文章的处理
8- let temp = ( status . longText && status . longText . longTextContent . replace ( / \n / g , '<br>' ) ) || status . text || '' ;
8+ let temp = ( status . longText && status . longText . longTextContent ) || status . text || '' ;
99 // 表情图标转换为文字
1010 temp = temp . replace ( / < s p a n c l a s s = " u r l - i c o n " > < i m g .* ?a l t = " ? ( .* ?) " ? [ \s \S ] * ?\/ > < \/ s p a n > / g, '$1' ) ;
1111 // 去掉外部链接的图标
@@ -21,6 +21,9 @@ const weiboUtils = {
2121 return decodeURIComponent ( p1 ) ;
2222 } ) ;
2323
24+ let originalText = temp ;
25+ temp = temp . replace ( / \n / g, '<br>' ) ;
26+
2427 // 添加用户名和头像
2528 let usernameAndAvatar = `<a href="https://weibo.com/${ status . user . id } ">` ;
2629 if ( showAuthorAvatar ) {
@@ -50,10 +53,11 @@ const weiboUtils = {
5053 temp += '<br clear="both" /><div style="clear: both"></div>' ;
5154 status . pics . forEach ( function ( item ) {
5255 temp += '<a href="' + item . large . url + '"><img vspace="8" hspace="4" src="' + item . large . url + '"></a>' ;
56+ originalText += '<img src="">'
5357 } ) ;
5458 }
5559
56- return { description : temp , retweetedOrOriginal : status . retweeted_status ? '🔁 ' + retweetedOrOriginal : temp } ;
60+ return { description : temp , retweetedOrOriginal : status . retweeted_status ? '🔁 ' + retweetedOrOriginal : originalText . replace ( '\n' , '' ) } ;
5761 } ,
5862 getShowData : async ( uid , bid ) => {
5963 const link = `https://m.weibo.cn/statuses/show?id=${ bid } ` ;
0 commit comments