-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(html-sanitize): Sanitize HTML comments in PR #4285
fix(html-sanitize): Sanitize HTML comments in PR #4285
Conversation
281ff7a
to
577f81f
Compare
@@ -964,6 +964,7 @@ export function getPrBody(input: string) { | |||
.replace(/<\/?summary>/g, '**') | |||
.replace(/<\/?details>/g, '') | |||
.replace(new RegExp(`\n---\n\n.*?<!-- .*?-rebase -->.*?(\n|$)`), '') | |||
.replace(new RegExp('<!--.*-->', 'g'), '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we be non greedy here '<!--.*?-->'
?
otherwise we would replace all:
<!-- comment -->
Text
<!-- other comment -->
.replace(new RegExp('<!--.*-->', 'g'), '') | |
.replace(new RegExp('<!--.*?-->', 'g'), '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. I will make sure that it works well with such scenarios as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the suggestion. if you like you can take it 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a good suggestion. Happy to use it.
577f81f
to
3f4b326
Compare
Sanitizes HTML comments inside PR body for BitBucket server. Includes snapshots for the tests. Refer renovatebot#3715
3f4b326
to
6163686
Compare
🎉 This PR is included in version 19.24.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Sanitizes HTML comments inside PR body for BitBucket server.
Closes #3715