diff options
Diffstat (limited to 'searx/utils.py')
| -rw-r--r-- | searx/utils.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/searx/utils.py b/searx/utils.py index ee044704b..a28171a32 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -154,6 +154,8 @@ def html_to_text(html_str: str) -> str: >>> html_to_text(r'regexp: (?<![a-zA-Z]') 'regexp: (?<![a-zA-Z]' """ + if not html_str: + return "" html_str = html_str.replace('\n', ' ').replace('\r', ' ') html_str = ' '.join(html_str.split()) s = _HTMLTextExtractor() |