mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-20 17:13:49 +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:
12 files changed
+110
-45
No files matched your search
@@ -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.
|
||||
|
||||
|
||||
Reference in new issue
Block a user