sam d1513af6f3 fix(telegram): close a code fence only on a matching run
CommonMark fences are three OR MORE backticks or tildes, and the closing
fence must be at least as long as the opening one. The parser hardcoded a
three-backtick prefix for both ends, so every longer fence was mangled:

  ````go              language became "`go", matching no grammar
  ```` wrapping ```   the outer fence closed at the inner one and the code
                      leaked out as paragraph blocks
  ~~~go               never recognised, and the "~~" emphasis pass then ate
                      two of the three tildes

The middle case is the damaging one: wrapping a reply in a longer fence is
how a model safely emits content that itself contains a fence, so getting it
wrong could wreck an entire reply rather than just its formatting.

Track the opening fence's character and run length, and close only on a run
of the same character that is at least as long and carries no info string.
2026-09-22 21:33:56 +10:00
S
Description
Archie connects events from your systems to agents that can investigate, reason, and act. Define what an event means, map its data into a workflow, and give that workflow an agent equipped for the job: its own execution environment, tools, and identity.
https://archie.catlow.cloud
Apache-2.0
133 MiB
0 Stars 1 Watchers 0 Forks
2026-11-10 10:01:23 +00:00
Languages
Go 76.8%
Vue 13.1%
TypeScript 7.8%
JavaScript 1.2%
Shell 0.6%
Other 0.4%