Skip to content

Commit 710fcc5

Browse files
committed
tests: fix quizlet
1 parent 284e29d commit 710fcc5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

Diff for: plugins/domains/quizlet.com.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
export default {
22

33
re: [
4-
/^https?:\/\/quizlet\.com\/(?:\w{2}\/)?(\d+)\/([^\/]+)\/?/i
4+
/^https?:\/\/quizlet\.com\/(?:\w{2}\/)?(\d+)\/[^\/]+\/?/i,
5+
/^https?:\/\/quizlet\.com\/(?:\w{2}\/)?(?:flashcards|match|learn|spell|test)\/[^\/]+\-(\d+)\/?(?:\?.+)?$/i
56
],
67

78
mixins: [
89
"*"
910
],
1011

11-
getLinks: function(urlMatch, options) {
12+
getLinks: function(url, urlMatch, options) {
13+
const TYPE_RE = /\/(flashcards|match|learn|spell|test)\//i;
1214

13-
var mode = options.getRequestOptions('quizlet.mode', /^flashcards|match|learn|spell|test$/i.test(urlMatch[2]) ? urlMatch[2] : 'flashcards');
15+
var mode = options.getRequestOptions('quizlet.mode', TYPE_RE.test(url) ? url.match(TYPE_RE)[1] : 'flashcards');
1416

1517
return {
1618
href: 'https://quizlet.com/' + urlMatch[1]+ '/' + mode + '/embed',
@@ -41,7 +43,7 @@ export default {
4143
"https://quizlet.com/43729824/scatter",
4244
"https://quizlet.com/43729824/gravity",
4345
"https://quizlet.com/43729824/test",
44-
"https://quizlet.com/ca/385594556/math-flash-cards/"
46+
"https://quizlet.com/ca/385594556/math-flash-cards/",
47+
"https://quizlet.com/test/conceptual-physics-final-review-part-1-43729824"
4548
]
46-
4749
};

0 commit comments

Comments
 (0)