fix(ai_news): escape MarkdownV2 reserved chars in score (+, -, .)

This commit is contained in:
2026-05-14 00:17:53 +09:00
parent 9f91dae1a4
commit 16941d76e8

View File

@@ -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'])}"
)