Wikipedia oneboxing עם hash מקטע מקודד ב-URL

סיכום מבוסס בינה מלאכותית

The discussion revolves around a Wikipedia oneboxing issue where URL-encoded section hashes in links, such as #La_th%C3%A9ologie_selon_Aristote, are not properly handled, leading to incorrect excerpts. Benjamin_D notes that while the links work, the onebox summary fails to reflect the correct section content. Falco clarifies that the issue lies in the onebox engine’s inability to match the section ID due to outdated code, referencing the relevant file wikipedia_onebox.rb. jbalsas proposes a fix by unescaping the URL hash name, submitting a pull request here and seeking confirmation on the contribution process.

I haven’t categorized the topic as bug because it might be by design, not sure…
so this works
https://fr.wikipedia.org/wiki/Th%C3%A9ologie#Platon

this doesn’t
https://fr.wikipedia.org/wiki/Th%C3%A9ologie#La_th%C3%A9ologie_selon_Aristote

Weirdly the span ids are La_th.C3.A9ologie_selon_Aristote and La_théologie_selon_Aristote :thinking: so I think there is something here: discourse/lib/onebox/engine/wikipedia_onebox.rb at 2f28ba318c3f650b1a0a76530021bc21bc8ab6f6 · discourse/discourse · GitHub

I sure hope so! :grin:

לייק 1

Both of your oneboxes work just fine for me in Android :thinking:

The links work yes, but for the second one the excerpt should be:

La poésie et les origines de la pensée… etc

ps. you had me :crazy_face: for a second here!

Oh you want the onebox summary to reflect the sub-section? That is controlled by

That is not matching

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

The code is over 7 years old, so it’s very possible that the Wikipedia markup changed in the meanwhile. It’s a pr-welcome if someone wants to work on this.

2 לייקים

I’ve sent a possible fix at Fix/wikipedia oneboxing with url encoded hash by jbalsas · Pull Request #14015 · discourse/discourse · GitHub.

I think unescaping the m_url_hash_name should be enough to cover all cases.

Hope this is the right process to contribute! :crossed_fingers:

3 לייקים