feat(autolink): tg#<id> message refs + GitHub-anchor line specs#34
feat(autolink): tg#<id> message refs + GitHub-anchor line specs#34alex-mextner wants to merge 1 commit into
Conversation
Three bounded fixes (ROADMAP §9 / tg-cli #28, #29, #32): tg#28 — `tg#<id>` message-ref convention. The inbound inject wrap now renders an inbound message id as `tg#<id>` (was bare `#<id>`), and a new `autolink-msgrefs` feature (ON by default) links those refs in outbound text. It runs BEFORE the `#N` PR pass, so a quoted-back `tg#3715` is never mis-resolved as issue/PR #3715. Deep link only for a supergroup chat; in a private DM the ref is marked but unlinked (no public per-message URL). tg#29 — file-excerpt attachment now also recognizes the GitHub permalink anchor forms `file#L10`, `file#L10-L20`, `file#L10-20` (second `L` optional) alongside `file:N` / `:N-M` / `:N:C`, so a pasted GitHub line link gets the inline excerpt + marker-injected attachment. Line numbers are 1-based across ALL forms now (a 0 line is rejected consistently). tg#32 — AGENTS.md stale "~578 tests" updated to the real current count. VERSION 1.11.0 -> 1.12.0 + CHANGELOG. New spec docs/specs/autolink-msgrefs.md; auto-attach spec updated for the `#L` forms. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f165a0fe63
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| * cleanly. */ | ||
| function styledRef(token: string): string { | ||
| const uni = toBoldItalic(token); | ||
| return uni !== null ? escapeHtml(uni) : `<i>${escapeHtml(token)}</i>`; |
There was a problem hiding this comment.
Prevent private tg refs from being re-linked as GitHub refs
In private DMs/basic groups msgRefUrl() returns null, so this path renders tg#3715 as plain styled text while leaving the ASCII #3715 outside any tag. If the same outbound message also has a resolved bare #3715, the later GitHub linkifier sees 𝒕𝒈#3715 as a valid #3715 boundary and rewrites the message reference into a GitHub link, defeating the namespace separation specifically in the no-deep-link case.
Useful? React with 👍 / 👎.
Three bounded fixes (ROADMAP §9 / tg-cli #28, #29, #32):
tg#28 —
tg#<id>message-ref convention. The inbound inject wrap nowrenders an inbound message id as
tg#<id>(was bare#<id>), and a newautolink-msgrefsfeature (ON by default) links those refs in outboundtext. It runs BEFORE the
#NPR pass, so a quoted-backtg#3715is nevermis-resolved as issue/PR #3715. Deep link only for a supergroup chat; in a
private DM the ref is marked but unlinked (no public per-message URL).
tg#29 — file-excerpt attachment now also recognizes the GitHub permalink
anchor forms
file#L10,file#L10-L20,file#L10-20(secondLoptional)alongside
file:N/:N-M/:N:C, so a pasted GitHub line link gets theinline excerpt + marker-injected attachment. Line numbers are 1-based across
ALL forms now (a 0 line is rejected consistently).
tg#32 — AGENTS.md stale "~578 tests" updated to the real current count.
VERSION 1.11.0 -> 1.12.0 + CHANGELOG. New spec docs/specs/autolink-msgrefs.md;
auto-attach spec updated for the
#Lforms.Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com