Spaces:
Running
Running
refactor: use a style tag instead of some inline styles
Browse files
app.py
CHANGED
@@ -154,7 +154,15 @@ def highlights_component(spans, show_alternatives, min_loss):
|
|
154 |
orig_token=html.escape(span["token"]).replace('\n', '<br>'),
|
155 |
hover=hover if show_alternative else ''
|
156 |
)
|
157 |
-
html_out = f"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
return st.html(html_out)
|
159 |
|
160 |
|
|
|
154 |
orig_token=html.escape(span["token"]).replace('\n', '<br>'),
|
155 |
hover=hover if show_alternative else ''
|
156 |
)
|
157 |
+
html_out = f"""
|
158 |
+
<style>
|
159 |
+
p.highlights-container {{
|
160 |
+
background: white;
|
161 |
+
line-height: 2.5;
|
162 |
+
}}
|
163 |
+
</style>
|
164 |
+
<p class="highlights-container">{html_out}</p>
|
165 |
+
"""
|
166 |
return st.html(html_out)
|
167 |
|
168 |
|