Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

纽约时报英文路由中,图片全部无法显示 #7442

Closed
RekiDunois opened this issue Apr 28, 2021 · 2 comments
Closed

纽约时报英文路由中,图片全部无法显示 #7442

RekiDunois opened this issue Apr 28, 2021 · 2 comments
Labels
RSS bug Something isn't working

Comments

@RekiDunois
Copy link
Contributor

RekiDunois commented Apr 28, 2021

路由地址(不包含参数)

/nytimes

完整路由地址,包含所有必选与可选参数

/nytimes/en

相关文档地址

预期是什么

获取到的文章中显示图片

实际发生了什么

只要路由参数为英文,图片就无法获取,但若参数为无(即默认中文)、中英对照、繁中 - 英文对照或繁体中文时,图片可以加载

  • 额外信息(日志、报错等)
    看了一下输出的 html 信息,当文章中有中文时,图片的 html 是这样的:
<figure class="article-span-photo">
  <img src="https://static01.nyt.com/images/2021/04/26/world/00virus-india-dispatch-promo/merlin_186812691_eff259bb-dcaa-448c-a995-218b4b41f6de-master1050.jpg" width="1050" height="700" alt="周五,在东德里,一处为新冠病毒死亡者准备的火葬地点。" referrerpolicy="no-referrer">
  <figcaption>
    <span>周五,在东德里,一处为新冠病毒死亡者准备的火葬地点。</span> 
    <cite>Atul Loke for The New York Times</cite>
  </figcaption>
</figure>

而当网页为纯英文时,输出的 html 是这样的:

<figure>
  <img src="https://www.nytimes.com/2021/04/27/world/asia/undefined" referrerpolicy="no-referrer">
  <br>
  <figcaption>A crematorium ground for Covid-19 victims in East Delhi, on Friday.</figcaption>
</figure>

推测是 lib\routes\nytimes\utils.js 下的 ProcessImage 函数出了问题,没有解析出正确的 img src.

另外,改版后的每日简报栏目(见 issue #7418 ),虽然输出是中文,但是他的域名仍是 www.nytimes.com,所以也需要使用英文的解析方式来输出内容

@github-actions
Copy link
Contributor

👍 感谢提交该 Issue,请确保仔细阅读 Issue 模板RSS 提案模板Feature 提案模板 以便于测试。不符合模板将导致 Issue 被直接关闭。

👍 Thanks for the issue, please follow the Issue template, RSS proposal template or Feature proposal template. Otherwise the issue will be closed.

@RekiDunois RekiDunois mentioned this issue Apr 29, 2021
10 tasks
@TonyRL
Copy link
Collaborator

TonyRL commented Feb 4, 2022

closed this in #7449

@TonyRL TonyRL closed this as completed Feb 4, 2022
@TonyRL TonyRL added the RSS bug Something isn't working label Feb 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RSS bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants