Disguise URLs so Firefox doesn't recognise them and filter them out
This commit is contained in:
parent
a8bbb9f303
commit
9920fc5ddd
|
@ -157,7 +157,7 @@ class Ranker:
|
|||
def complete(self, q: str):
|
||||
ordered_results, terms, completions = self.get_results(q)
|
||||
filtered_completions = [c for c in completions if c != terms[-1]]
|
||||
urls = [item.url[len(HTTPS_STRING):].rstrip('/') for item in ordered_results[:5]
|
||||
urls = [item.url[len(HTTPS_STRING):].rstrip('/').replace('.', '․').replace('/', ' ∕ ') for item in ordered_results[:5]
|
||||
if item.url.startswith(HTTPS_STRING) and all(term in item.url for term in terms)][:1]
|
||||
completed = [' '.join(terms[:-1] + [t]) for t in filtered_completions]
|
||||
return [q, urls + completed]
|
||||
|
|
Loading…
Reference in New Issue