kcarnold commited on
Commit
c95fdb0
·
1 Parent(s): 3951ed3

refactor: use a style tag instead of some inline styles

Browse files
Files changed (1) hide show
  1. app.py +9 -1
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"<p style=\"background: white; line-height: 2.5;\">{html_out}</p>"
 
 
 
 
 
 
 
 
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