mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 22:46:27 +00:00
fix: Escape scoped package names in PR bodies (#568)
GitHub attempts to autolink any @user mention and this causes problems when we use scoped npm modules like `@types/gulp`. This escapes such package names with a zero width space to fool GitHub’s parser. Fixes #518
This commit is contained in:
parent
8374ef6caa
commit
6cd398f0c5
3 changed files with 5 additions and 3 deletions
|
@ -1,4 +1,4 @@
|
|||
This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency [{{depName}}]({{repositoryUrl}}) from version `{{currentVersion}}` to `{{newVersion}}`{{#if isRollback}}. This is necessary and important because version `{{currentVersion}}` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||
This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}`depName`{{/if}} from version `{{currentVersion}}` to `{{newVersion}}`{{#if isRollback}}. This is necessary and important because version `{{currentVersion}}` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||
{{#if releases.length}}
|
||||
|
||||
{{#if schedule}}
|
||||
|
|
|
@ -114,7 +114,9 @@ async function ensurePr(inputConfig, logger, errors, warnings) {
|
|||
}
|
||||
|
||||
const prTitle = handlebars.compile(config.prTitle)(config);
|
||||
const prBodyMarkdown = handlebars.compile(config.prBody)(config);
|
||||
let prBodyMarkdown = handlebars.compile(config.prBody)(config);
|
||||
const atUserRe = /@([a-z]+\/[a-z]+)/;
|
||||
prBodyMarkdown = prBodyMarkdown.replace(atUserRe, '@​$1');
|
||||
const prBody = converter.makeHtml(prBodyMarkdown);
|
||||
|
||||
try {
|
||||
|
|
|
@ -110,7 +110,7 @@ This {{#if isGitHub}}PR{{else}}MR{{/if}} has been generated by [Renovate Bot](ht
|
|||
"labels": Array [],
|
||||
"lazyGrouping": true,
|
||||
"message": "Failed to look up dependency",
|
||||
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency [{{depName}}]({{repositoryUrl}}) from version \`{{currentVersion}}\` to \`{{newVersion}}\`{{#if isRollback}}. This is necessary and important because version \`{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||
"prBody": "This {{#if isGitHub}}Pull{{else}}Merge{{/if}} Request {{#if isRollback}}rolls back{{else}}updates{{/if}} dependency {{#if repositoryUrl}}[{{depName}}]({{repositoryUrl}}){{else}}\`depName\`{{/if}} from version \`{{currentVersion}}\` to \`{{newVersion}}\`{{#if isRollback}}. This is necessary and important because version \`{{currentVersion}}\` cannot be found in the npm registry - probably because of it being unpublished.{{/if}}
|
||||
{{#if releases.length}}
|
||||
|
||||
{{#if schedule}}
|
||||
|
|
Loading…
Reference in a new issue