1
0
mirror of https://github.com/searxng/searxng.git synced 2024-10-04 02:20:13 +02:00

Merge pull request #1056 from capric98/master

Unquote path on result page.
This commit is contained in:
Alexandre Flament 2022-04-05 07:59:18 +02:00 committed by GitHub
commit fcb626dedd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@ from typing import List, Dict, Iterable, Optional
import urllib
import urllib.parse
from urllib.parse import urlencode
from urllib.parse import urlencode, unquote
import httpx
@ -434,7 +434,7 @@ def _get_enable_categories(all_categories: Iterable[str]):
def get_pretty_url(parsed_url: urllib.parse.ParseResult):
path = parsed_url.path
path = path[:-1] if len(path) > 0 and path[-1] == '/' else path
path = path.replace("/", " ")
path = unquote(path).replace("/", " ")
return [parsed_url.scheme + "://" + parsed_url.netloc, path]