Skip to content

Commit

Permalink
fix(bitbucket): source link root path (#32676)
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy authored Nov 22, 2024
1 parent e3b97c1 commit b7951c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/modules/platform/bitbucket/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1656,6 +1656,14 @@ describe('modules/platform/bitbucket/index', () => {

expect(bitbucket.massageMarkdown(prBody)).toMatchSnapshot();
});

it('converts source links', () => {
const prBody = '[source](https://bitbucket.org/foo/bar/tree/HEAD)';

expect(bitbucket.massageMarkdown(prBody)).toBe(
'[source](https://bitbucket.org/foo/bar/src/HEAD)',
);
});
});

describe('updatePr()', () => {
Expand Down
1 change: 1 addition & 0 deletions lib/modules/platform/bitbucket/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,7 @@ export function massageMarkdown(input: string): string {
.replace(regEx(/<\/?(details|blockquote)>/g), '')
.replace(regEx(`\n---\n\n.*?<!-- rebase-check -->.*?\n`), '')
.replace(regEx(/\]\(\.\.\/pull\//g), '](../../pull-requests/')
.replace(regEx(/\/tree\/HEAD/g), '/src/HEAD')
.replace(regEx(/<!--renovate-(?:debug|config-hash):.*?-->/g), '');
}

Expand Down

0 comments on commit b7951c3

Please sign in to comment.