Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -51,11 +51,11 @@ def search_and_highlight(full_text, keyword):
|
|
| 51 |
)
|
| 52 |
results.append(highlighted_context)
|
| 53 |
|
| 54 |
-
# Highlight for
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
f'<span style="background-color: yellow;">{
|
| 58 |
-
|
| 59 |
)
|
| 60 |
|
| 61 |
return results, html_text
|
|
|
|
| 51 |
)
|
| 52 |
results.append(highlighted_context)
|
| 53 |
|
| 54 |
+
# Highlight for full text
|
| 55 |
+
highlighted_text = (
|
| 56 |
+
highlighted_text[:start] +
|
| 57 |
+
f'<span style="background-color: yellow;">{highlighted_text[start:end]}</span>' +
|
| 58 |
+
highlighted_text[end:]
|
| 59 |
)
|
| 60 |
|
| 61 |
return results, html_text
|