Dmitry Beresnev commited on
Commit
ab86fc1
·
1 Parent(s): 93bc4a9

fix prediction market section

Browse files
Files changed (1) hide show
  1. app/components/news.py +4 -2
app/components/news.py CHANGED
@@ -198,7 +198,8 @@ def display_scrollable_news_section(df: pd.DataFrame, section_title: str, sectio
198
  sentiment_color = sentiment_colors.get(news_item['sentiment'], '#787B86')
199
 
200
  # Escape HTML
201
- summary = html_module.escape(news_item.get('summary', '').strip())
 
202
  source = html_module.escape(news_item['source'])
203
  category = html_module.escape(news_item['category'])
204
  url = html_module.escape(news_item['url'])
@@ -217,7 +218,8 @@ def display_scrollable_news_section(df: pd.DataFrame, section_title: str, sectio
217
  </div>
218
  <span style="color: #787B86; font-size: 11px; white-space: nowrap;">{time_ago}</span>
219
  </div>
220
- <div style="color: #D1D4DC; font-size: 14px; line-height: 1.5; margin-bottom: 8px; margin-left: 8px; font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;">{summary}</div>
 
221
  <a href="{url}" target="_blank" style="color: #3861FB; font-size: 12px; text-decoration: none; margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500;" onmouseover="this.style.color='#5880FF';" onmouseout="this.style.color='#3861FB';">Read Full Story →</a>
222
  </div>
223
  """
 
198
  sentiment_color = sentiment_colors.get(news_item['sentiment'], '#787B86')
199
 
200
  # Escape HTML
201
+ title = html_module.escape(str(news_item.get('title', '')).strip())
202
+ summary = html_module.escape(str(news_item.get('summary', '')).strip())
203
  source = html_module.escape(news_item['source'])
204
  category = html_module.escape(news_item['category'])
205
  url = html_module.escape(news_item['url'])
 
218
  </div>
219
  <span style="color: #787B86; font-size: 11px; white-space: nowrap;">{time_ago}</span>
220
  </div>
221
+ <div style="color: #E0E3EB; font-size: 14px; font-weight: 600; margin-bottom: 6px; margin-left: 8px; font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;">{title if title else summary}</div>
222
+ <div style="color: #D1D4DC; font-size: 13px; line-height: 1.5; margin-bottom: 8px; margin-left: 8px; font-family: -apple-system, BlinkMacSystemFont, 'Trebuchet MS', Roboto, Ubuntu, sans-serif;">{summary if title else ''}</div>
223
  <a href="{url}" target="_blank" style="color: #3861FB; font-size: 12px; text-decoration: none; margin-left: 8px; display: inline-flex; align-items: center; gap: 4px; font-weight: 500;" onmouseover="this.style.color='#5880FF';" onmouseout="this.style.color='#3861FB';">Read Full Story →</a>
224
  </div>
225
  """