Fix: `keep_blank_values = True` to handle blank `q` input (#1052)

main
Ahmad Alkadri 2023-08-21 22:53:10 +02:00 committed by GitHub
parent a40b98341b
commit 4a0089686e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ def extract_q(q_str: str, href: str) -> str:
Returns: Returns:
str: The 'q' element of the link, or an empty string str: The 'q' element of the link, or an empty string
""" """
return parse_qs(q_str)['q'][0] if ('&q=' in href or '?q=' in href) else '' return parse_qs(q_str, keep_blank_values=True)['q'][0] if ('&q=' in href or '?q=' in href) else ''
def build_map_url(href: str) -> str: def build_map_url(href: str) -> str: