-
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(changelog): remove urls from md heading url #23112
fix(changelog): remove urls from md heading url #23112
Conversation
🎉 This PR is included in version 35.159.3 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
@@ -6,7 +6,7 @@ import { regEx } from './regex'; | |||
export function sanitizeMarkdown(markdown: string): string { | |||
let res = markdown; | |||
// Put a zero width space after every # followed by a digit | |||
res = res.replace(regEx(/#(\d)/gi), '#​$1'); | |||
res = res.replace(regEx(/\W#(\d)/gi), '#​$1'); |
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.
this removes the char before the #
🤦♂️
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.
Do you have an example.... I can add this to the test-cases...
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 think this might be better
regex: (\W)#(\d)
replacement: $1#$2
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.
The other route I explored was using %23
instead of the #
in release-notes.ts
and then re-replacing it from %23
to #
at the end of sanitizeMarkdown
....
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 tried reproducing the "removes the char before #", but couldn't... 🤔
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 think this might be better
regex:
(\W)#(\d)
replacement: $1#$2
yes, otherwise the chat before will be removed, see screenshot and sample markdown on other PR comment
Adding missing test scenario #23160 |
Changes
Removes any urls when generating the markdown header url
Context
Current behavior generates markdown header urls for standard-version changelog files that include the github compare url
This PR ensures that this is omitted when generating the markdown header url link
Test Repository:
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via: