Add support for the character ^ to be used in URL parameters#267
Add support for the character ^ to be used in URL parameters#267OscarBataille wants to merge 2 commits intogregjacobs:masterfrom
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
| // 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.
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
|
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.