|
@@ -28,7 +28,7 @@ def highlight_content(content, query):
|
28
|
28
|
query = query.decode('utf-8')
|
29
|
29
|
if content.lower().find(query.lower()) > -1:
|
30
|
30
|
query_regex = u'({0})'.format(re.escape(query))
|
31
|
|
- content = re.sub(query_regex, '<b>\\1</b>', content, flags=re.I | re.U)
|
|
31
|
+ content = re.sub(query_regex, '<span class="highlight">\\1</span>', content, flags=re.I | re.U)
|
32
|
32
|
else:
|
33
|
33
|
regex_parts = []
|
34
|
34
|
for chunk in query.split():
|
|
@@ -37,7 +37,7 @@ def highlight_content(content, query):
|
37
|
37
|
else:
|
38
|
38
|
regex_parts.append(u'{0}'.format(re.escape(chunk)))
|
39
|
39
|
query_regex = u'({0})'.format('|'.join(regex_parts))
|
40
|
|
- content = re.sub(query_regex, '<b>\\1</b>', content, flags=re.I | re.U)
|
|
40
|
+ content = re.sub(query_regex, '<span class="highlight">\\1</span>', content, flags=re.I | re.U)
|
41
|
41
|
|
42
|
42
|
return content
|
43
|
43
|
|