fix encoding display from result links

This commit is contained in:
Kyle Drake 2024-12-12 17:05:22 -06:00
parent afef407744
commit 1463074f35
2 changed files with 4 additions and 1 deletions

View file

@ -147,6 +147,9 @@ get '/browse/search' do
@total_results = @resp['searchInformation']['totalResults'].to_i
@resp['items'].each do |item|
link = Addressable::URI.parse(item['link'])
item['readable_link'] = link.host+Rack::Utils.unescape(Rack::Utils.unescape(link.path)) # Yes, it needs to be decoded twice
item['link'] = link
next if link.host == 'neocities.org'
username = link.host.split('.').first