Files
hermes-agent/plugins/platforms
Teknium ededca00f9 fix(telegram): lone * in bold stays visible; rich $ escape skips all code linearly
#151722: `**rm -rf *.tmp**` came out as `\*_rm \-rf \.tmp_`: the `*` of
`*.tmp` (it can both open and close) closed one star of the `**` opener, so
bold turned italic and the star vanished. Pairing now applies CommonMark's
rule of 3, and a bare `**` closer reaches past single-star openers to the
`**` opener (chat text means bold around a literal star; CommonMark's nested
italics would drop it). Backslash-escaped stars (`**Use \*args**`) are
literal. Failed searches remember their floor per closer class, so pairing
stays linear.

#151725: the rich-message `$` escape found code with a backreference regex
that rescanned to end of line from every unmatched backtick run (32 KB in
~2-5 s on the event loop) and knew only closed ``` fences and one-line spans,
so it put `\$` inside a streaming (unclosed) fence, ~~~ fences, indented code,
nested fences and <code>. New rich_code_regions.py finds code in one pass
(block fences incl. unclosed-to-end, indented blocks, width-matched backtick
spans by bisect, <pre>/<code>); the escape and the link degrade run only on
the prose between. standalone's HTML-tag sniff uses the same scan. A TeX
command's {...} argument may hold words, so `$1\text{ kg}$` stays math.

Fixes #151722
Fixes #151725
2026-11-10 13:16:03 -08:00
..
…
…
…
…
…
…