mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-22 16:11:29 +00:00
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:
parent
3029b3468f
commit
bf76b9342f
12 changed files with 110 additions and 45 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue