TradingAgents/tradingagents/ui
Youssef Aitousarrah 6a9a190af5 fix(ui): fix signal cards rendering as raw HTML in Streamlit
Two bugs were causing the signal card HTML to display as literal text:

1. CommonMark HTML block termination: Streamlit's markdown parser
   (CommonMark-compliant) terminates a <div> block at the first blank
   line. Empty optional fields (name_html, desc_html, risk_badge_html)
   left whitespace-only lines in the f-string template, ending the HTML
   block and causing the parser to render subsequent tags as text.
   Fixed by building HTML from a parts list and only appending optional
   elements when non-empty — no blank lines can appear in output.

2. Unescaped HTML chars in LLM-generated text: reason fields from the
   ranker contained raw > and & characters (e.g. '>5% move',
   '50 & 200 SMA') that corrupted the HTML structure. Fixed by running
   all LLM-generated fields through html.escape() before interpolation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-20 11:33:15 -08:00
..
pages Update 2026-02-20 08:53:37 -08:00
__init__.py feat: discovery pipeline enhancements with ML signal scanner 2026-02-09 22:53:42 -08:00
dashboard.py feat: add daily discovery workflow, recommendation history, and scanner improvements 2026-02-11 22:07:02 -08:00
theme.py fix(ui): fix signal cards rendering as raw HTML in Streamlit 2026-02-20 11:33:15 -08:00
utils.py feat: add daily discovery workflow, recommendation history, and scanner improvements 2026-02-11 22:07:02 -08:00