WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 5b9055e

Browse files
committed
Replaces static pull request URLs in footnotes with command action links,
enabling its tracking (#4764, #4765, PLG-139)
1 parent aced349 commit 5b9055e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/git/formatters/commitFormatter.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,18 @@ export class CommitFormatter extends Formatter<GitCommit, CommitFormatOptions> {
869869
const prTitle = escapeMarkdown(pr.title).replace(/"/g, '\\"').trim();
870870

871871
const index = this._options.footnotes.size + 1;
872+
const prCommandLink = createMarkdownActionCommandLink<OpenPullRequestActionContext>(
873+
'openPullRequest',
874+
{
875+
repoPath: this._item.repoPath,
876+
provider: { id: pr.provider.id, name: pr.provider.name, domain: pr.provider.domain },
877+
pullRequest: { id: pr.id, url: pr.url },
878+
source: { source: this._options.source.source, detail: 'footnote' },
879+
},
880+
);
872881
this._options.footnotes.set(
873882
index,
874-
`${getIssueOrPullRequestMarkdownIcon(pr)} [**${prTitle}**](${pr.url} "Open Pull Request \\#${
883+
`${getIssueOrPullRequestMarkdownIcon(pr)} [**${prTitle}**](${prCommandLink} "Open Pull Request \\#${
875884
pr.id
876885
} on ${pr.provider.name}")\\\n${GlyphChars.Space.repeat(4)} #${pr.id} ${
877886
pr.state

0 commit comments

Comments
 (0)