fix(ai_news): escape MarkdownV2 reserved chars in score (+, -, .)
This commit is contained in:
@@ -19,9 +19,10 @@ def _cost_won(tokens_input: int, tokens_output: int) -> int:
|
||||
|
||||
def _row_line(idx: int, r: Dict[str, Any]) -> str:
|
||||
score = r["score_raw"]
|
||||
sign = "+" if score >= 0 else ""
|
||||
# score 문자열 자체를 _escape 통과 — '+', '-', '.' 모두 MarkdownV2 reserved
|
||||
score_str = _escape(f"{score:+.1f}")
|
||||
return (
|
||||
f"{idx}\\. {_escape(r['ticker'])} \\({sign}{score:.1f}\\) — "
|
||||
f"{idx}\\. {_escape(r['ticker'])} \\({score_str}\\) — "
|
||||
f"{_escape(r['reason'])}"
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user