diff options
| author | Adam Tauber <asciimoo@gmail.com> | 2014-05-16 16:51:23 +0200 |
|---|---|---|
| committer | Adam Tauber <asciimoo@gmail.com> | 2014-05-16 16:51:23 +0200 |
| commit | 73948f302079b738131969e9b745ee77d11e82d3 (patch) | |
| tree | 902ce5218ade931bec9348db94a5ce6eb2e37a54 /searx/utils.py | |
| parent | 7e946a369b5caae3997fb9398a8a40a2ef389193 (diff) | |
[fix] pep8
Diffstat (limited to 'searx/utils.py')
| -rw-r--r-- | searx/utils.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/searx/utils.py b/searx/utils.py index e881a8b14..c6f3394c2 100644 --- a/searx/utils.py +++ b/searx/utils.py @@ -28,7 +28,8 @@ def highlight_content(content, query): query = query.decode('utf-8') if content.lower().find(query.lower()) > -1: query_regex = u'({0})'.format(re.escape(query)) - content = re.sub(query_regex, '<span class="highlight">\\1</span>', content, flags=re.I | re.U) + content = re.sub(query_regex, '<span class="highlight">\\1</span>', + content, flags=re.I | re.U) else: regex_parts = [] for chunk in query.split(): @@ -37,7 +38,8 @@ def highlight_content(content, query): else: regex_parts.append(u'{0}'.format(re.escape(chunk))) query_regex = u'({0})'.format('|'.join(regex_parts)) - content = re.sub(query_regex, '<span class="highlight">\\1</span>', content, flags=re.I | re.U) + content = re.sub(query_regex, '<span class="highlight">\\1</span>', + content, flags=re.I | re.U) return content |