Wikipedia的URL编码段哈希的单框显示

我还没有将此话题归类为 bug,因为这可能是设计如此,还不确定……
所以这个可以工作
https://fr.wikipedia.org/wiki/Th%C3%A9ologie#Platon

而这个不行
https://fr.wikipedia.org/wiki/Th%C3%A9ologie#La_th%C3%A9ologie_selon_Aristote

奇怪的是,span id 分别是 La_th.C3.A9ologie_selon_AristoteLa_théologie_selon_Aristote :thinking: 所以我认为问题出在这里:discourse/lib/onebox/engine/wikipedia_onebox.rb at 2f28ba318c3f650b1a0a76530021bc21bc8ab6f6 · discourse/discourse · GitHub

我也非常希望如此!:grinning_face_with_smiling_eyes:

1 个赞

两个 onebox 在我安卓设备上都能正常运行 :thinking:

链接确实可以打开,但第二个链接的摘要应为:

诗歌与思想的起源……等等

PS:你刚才差点把我吓到 :crazy_face:

哦,你是想让 onebox 摘要反映子章节?这由以下代码控制:

但它无法匹配:

<h3>
  <span id="La_th.C3.A9ologie_selon_Aristote"></span>
  <span id="La_théologie_selon_Aristote">La théologie selon Aristote</span>
</h3>

这段代码已有 7 年多未更新,因此维基百科的标记在此期间很可能已发生变化。如果有人愿意处理这个问题,欢迎提交 PR。

2 个赞

我已在 Fix/wikipedia oneboxing with url encoded hash by jbalsas · Pull Request #14015 · discourse/discourse · GitHub 提交了一个可能的修复方案。

我认为只需对 m_url_hash_name 进行取消转义就足以覆盖所有情况。

希望这是正确的贡献流程!:crossed_fingers:

3 个赞