mirror of
https://github.com/DIYgod/RSSHub.git
synced 2026-09-01 14:57:14 +08:00
fix(route): 修复 部分情况下 url.expanded_url 可能为 undefined 的问题 (#17560)
fix #17382 Co-authored-by: CaoMeiYouRen <996881204@qq.com>
This commit is contained in:
@@ -35,7 +35,7 @@ const formatText = (item) => {
|
||||
const urls = item.entities.urls || [];
|
||||
for (const url of urls) {
|
||||
// trim link pointing to the tweet itself (usually appears when the tweet is truncated)
|
||||
text = text.replaceAll(url.url, url.expanded_url.endsWith(id_str) ? '' : url.expanded_url);
|
||||
text = text.replaceAll(url.url, url.expanded_url?.endsWith(id_str) ? '' : url.expanded_url);
|
||||
}
|
||||
const media = item.extended_entities?.media || [];
|
||||
for (const m of media) {
|
||||
|
||||
Reference in New Issue
Block a user