-
Notifications
You must be signed in to change notification settings - Fork 12
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: same text and url #68
base: main
Are you sure you want to change the base?
Conversation
utils/markdown.ts
Outdated
if (url) { | ||
return match.replace( | ||
`(${path})`, | ||
`(${cdnBaseURL}/${path.replace(/^\.\//, "")})`, |
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.
Can you please double-check if we could fix/improve the regex above? generating new (${path})
seems hacky to replace while haven't tried it locally... Also what is a sample README URL we can test against?
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.
Yes, here some readme where there is the issue: #68 (comment)
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 updated the regexp to simplify code and avoid too many if.
6f6f300
to
ca9be8b
Compare
π Linked issue
β Type of change
π Description
If a link looks like this
[./example](./example)
, current implementation will return[https://raw.githubusercontent.com/example](./example)
, which is not the expected behavior.This PR fixes this issue by checking replacing the link but not the text.
we could start adding some using testing to validate utils functions and edge cases
π Checklist