Skip to content
Snippets Groups Projects
Unverified Commit b7951c3c authored by Adam Setch's avatar Adam Setch Committed by GitHub
Browse files

fix(bitbucket): source link root path (#32676)

parent e3b97c13
No related branches found
No related tags found
No related merge requests found
...@@ -1656,6 +1656,14 @@ describe('modules/platform/bitbucket/index', () => { ...@@ -1656,6 +1656,14 @@ describe('modules/platform/bitbucket/index', () => {
expect(bitbucket.massageMarkdown(prBody)).toMatchSnapshot(); 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()', () => { describe('updatePr()', () => {
......
...@@ -583,6 +583,7 @@ export function massageMarkdown(input: string): string { ...@@ -583,6 +583,7 @@ export function massageMarkdown(input: string): string {
.replace(regEx(/<\/?(details|blockquote)>/g), '') .replace(regEx(/<\/?(details|blockquote)>/g), '')
.replace(regEx(`\n---\n\n.*?<!-- rebase-check -->.*?\n`), '') .replace(regEx(`\n---\n\n.*?<!-- rebase-check -->.*?\n`), '')
.replace(regEx(/\]\(\.\.\/pull\//g), '](../../pull-requests/') .replace(regEx(/\]\(\.\.\/pull\//g), '](../../pull-requests/')
.replace(regEx(/\/tree\/HEAD/g), '/src/HEAD')
.replace(regEx(/<!--renovate-(?:debug|config-hash):.*?-->/g), ''); .replace(regEx(/<!--renovate-(?:debug|config-hash):.*?-->/g), '');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment