style(formatters): render branch/commit/tag refs as inline code with hyperlinks

Unify all branch, commit hash and tag references across formatters to the push commit style (inline code + link). Adds commitLink/branchLink/tagLink helpers in formatters/helpers.ts, links branches to /tree/, tags to /releases/tag/, and PR head branches to the fork repo. Drops the backticks from the en/zh locale templates around {ref}/{sha} since the formatters now inject pre-linked values.
This commit is contained in:
RhenCloud 2026-08-13 06:37:45 +08:00
parent 3029b3468f
commit bf76b9342f
No known key found for this signature in database
GPG key ID: A574A617378C4E0B
12 changed files with 110 additions and 45 deletions

View file

@ -122,6 +122,10 @@ src/__tests__/ # bun test unit tests (webhook, formatter, discord, te
the locale files. Emoji is controlled per group through the `Group.emoji` toggle (default true);
`showEmoji=false` must strip every emoji from titles, descriptions, fields and links.
- Milestone progress bars (🟢🟡🟠⬜) are data visualization and are exempt from the emoji toggle.
- Commit hashes, branches and tags render as inline code wrapped in a hyperlink
(`commitLink`/`branchLink`/`tagLink` helpers in `src/formatters/helpers.ts`, e.g.
``[`abc123d`](https://.../commit/abc123def456)``, ``[`main`](https://.../tree/main)``),
falling back to plain inline code when the repo base URL is unavailable.
- Locale templates use a `{emoji}` placeholder immediately followed by the text (no space);
the formatter injects `em(...)` which carries the trailing space.