Skip to content

Commit

Permalink
fix: partial url regexp
Browse files Browse the repository at this point in the history
It was not working with relative URLs not starting with /
Now it determines url as partial if it does not start with http: or https:
  • Loading branch information
AlexP11223 committed Apr 17, 2021
1 parent 4eb702b commit 6f93e90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/model/helpers/card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface LinksBuilderOptions {
urlSelector?: string;
}

const isPartialUrlRegExp = /^\/[^/]/i;
const isPartialUrlRegExp = /^(?!https?:).*/i;

export function getProductLinksBuilder(options: LinksBuilderOptions) {
return (docElement: cheerio.Cheerio, series: Series): Link[] => {
Expand Down

0 comments on commit 6f93e90

Please sign in to comment.