-
-
Notifications
You must be signed in to change notification settings - Fork 0
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 must have protocol #3
Conversation
As most markdown parses don't parse links without protocols.
…n't parse <my-domain.com>
Releases: react-markdown-autolink@0.0.2 @repo/shared@0.0.2
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 1 1
Lines 5 7 +2
Branches 2 3 +1
=========================================
+ Hits 5 7 +2 ☔ View full report in Codecov by Sentry. |
Here's the code health analysis summary for commits Analysis Summary
|
lib/src/index.ts
Outdated
@@ -1,5 +1,5 @@ | |||
export const autoLinkMd = (str: string) => | |||
str.replace( | |||
/((ftp|https?):\/\/)?[\w_-]+(\.[\w_-]+)+[\w@?^=%&\/~+#-.:,]*[\w@?^=%&\/~+#-]/g, | |||
/(ftp|https?):\/\/[\w_-]+(\.[\w_-]+)+[\w@?^=%&\/~+#-.:,]*[\w@?^=%&\/~+#-]|[\w._%+-]+@[\w.-]+\.[a-zA-Z]{2,}/g, |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
lib/src/index.ts
Outdated
); | ||
str | ||
.replace( | ||
/(ftp|https?):\/\/[\w_-]+(\.[\w_-]+)+[\w@?^=%&/~+#-.:,]*[\w@?^=%&/~+#-]/g, |
Check warning
Code scanning / CodeQL
Overly permissive regular expression range Medium
URLs must have protocols, as many parses do not parse <google.com> without the protocol.