-
Notifications
You must be signed in to change notification settings - Fork 239
Add support for the character ^ to be used in URL parameters #267
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
base: master
Are you sure you want to change the base?
Conversation
Hey Oscar, thanks for the contribution. Can you add a test or two that shows URLs that should be linked which currently aren't? |
src/matcher/url-matcher.ts
Outdated
@@ -76,7 +76,7 @@ export class UrlMatcher extends Matcher { | |||
|
|||
// Allow optional path, query string, and hash anchor, not ending in the following characters: "?!:,.;" | |||
// http://blog.codinghorror.com/the-problem-with-urls/ | |||
urlSuffixRegex = new RegExp( '[/?#](?:[' + alphaNumericAndMarksCharsStr + '\\-+&@#/%=~_()|\'$*\\[\\]?!:,.;\u2713]*[' + alphaNumericAndMarksCharsStr + '\\-+&@#/%=~_()|\'$*\\[\\]\u2713])?' ); | |||
urlSuffixRegex = new RegExp( '[/?#](?:[' + alphaNumericAndMarksCharsStr + '\\-\\^+&@#/%=~_()|\'$*\\[\\]?!:,.;\u2713]*[' + alphaNumericAndMarksCharsStr + '\\-\\^+&@#/%=~_()|\'$*\\[\\]\u2713])?' ); |
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.
Just fyi, the ^
character doesn't need to be escaped in a regular expression character class unless it is the first character in the character class
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.
Thanks
Just added the tests |
Hey @OscarBataille. Sorry for the late reply on this! Thanks for the tests so far. Can you add just a couple tests in autolinker.spec.ts too which check the full link generation? Btw, do you have a real URL where Thanks, |
Hey @gregjacobs , Indeed https://www.ietf.org/rfc/rfc1738.txt says that ^ is an unsafe character. Is there already some way to encode URL characters or does it need to be implemented ? I don't have access to a public URL where this character is used because we encountered the problem on a internal URL. Thanks, |
No description provided.