Skip to content

Fix amazon.com.br links not working#47

Open
marciogranzotto wants to merge 1 commit intoLucaTNT:mainfrom
marciogranzotto:main
Open

Fix amazon.com.br links not working#47
marciogranzotto wants to merge 1 commit intoLucaTNT:mainfrom
marciogranzotto:main

Conversation

@marciogranzotto
Copy link

Amazon Brazil's link is amazon.com.br, but setting AMAZON_TLD=com.br doesn't work because it contains a . that needs to be escaped on regex, and the fullURLRegex didn't match the 3rd group (.com.br).

To fix it I:

  • added a regex escape function to build the amazon URL
  • changed the 3rd regex group for fullURLRegex to match from 1 to 2 times

@LucaTNT
Copy link
Owner

LucaTNT commented Dec 15, 2021

Thanks for the PR!

Just a question: shouldn't the regExpEscape() function be applied to the regexp in the definition of rawUrlRegex constant rather than to the buildAmazonUrl() function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants