Skip to content

A platform for community discussion. Free, open, simple.

FIX: Unescapes hash section with present to account for url-encoded chars

Chema Balsasd27d7c8ccac4
diff --git a/lib/onebox/engine/wikipedia_onebox.rb b/lib/onebox/engine/wikipedia_onebox.rb
index e86a9014334..6d7d40424a0 100644
--- a/lib/onebox/engine/wikipedia_onebox.rb
+++ b/lib/onebox/engine/wikipedia_onebox.rb
@@ -24,7 +24,7 @@ module Onebox
end
unless m_url_hash.nil?
- section_header_title = raw.xpath("//span[@id='#{m_url_hash_name}']")
+ section_header_title = raw.xpath("//span[@id='#{CGI.unescape(m_url_hash_name)}']")
if section_header_title.empty?
paras = raw.search("p") # default get all the paras