MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / linkifyIssueRefs

Function linkifyIssueRefs

packages/bumpy/src/core/changelog-github.ts:346–353  ·  view source on GitHub ↗

* Linkify bare issue/PR references like #123 in text, * but skip references already inside markdown links.

(line: string, serverUrl: string, repo?: string)

Source from the content-addressed store, hash-verified

344 * but skip references already inside markdown links.
345 */
346function linkifyIssueRefs(line: string, serverUrl: string, repo?: string): string {
347 if (!repo) return line;
348 // "match what you skip, capture what you want" pattern:
349 // the left alternative consumes markdown links so the right alternative only matches bare refs
350 return line.replace(/\[.*?\]\(.*?\)|\B#([1-9]\d*)\b/g, (match, issue) =>
351 issue ? `[#${issue}](${serverUrl}/${repo}/issues/${issue})` : match,
352 );
353}
354
355/** Try to detect the repo slug from the gh CLI */
356function detectRepo(): string | undefined {

Callers 1

linkifyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…