fix: weibo emoji dom update (#5056)

This commit is contained in:
simoin
2020-06-25 23:46:34 +08:00
committed by GitHub
parent 1bde990f52
commit 9004ca75f0
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -61,7 +61,7 @@ module.exports = async (ctx) => {
const link = `https://weibo.com/${uid}/${item.mblog.bid}`;
let description = weiboUtils.format(item.mblog);
const title = description.replace(/<img.*?>/g, '[图片]').replace(/<.*?>/g, '');
const title = description.replace(/<img[\s\S]*?>/g, '[图片]').replace(/<.*?>/g, '');
const pubDate = isDataOK ? new Date(data.created_at).toUTCString() : date(item.mblog.created_at, 8);
// 视频的处理
+1 -1
View File
@@ -5,7 +5,7 @@ const weiboUtils = {
// 长文章的处理
let temp = (status.longText && status.longText.longTextContent.replace(/\n/g, '<br>')) || status.text || '';
// 表情图标转换为文字
temp = temp.replace(/<span class="url-icon"><img.*?alt="?(.*?)"? .*?\/><\/span>/g, '$1');
temp = temp.replace(/<span class="url-icon"><img.*?alt="?(.*?)"? [\s\S]*?\/><\/span>/g, '$1');
// 去掉外部链接的图标
temp = temp.replace(/<span class=["|']url-icon["|']>.*?<\/span><span class="surl-text">(.*?)<\/span>/g, '$1');
// 去掉乱七八糟的图标