Skip to content

Commit

Permalink
Remove the special case in the getThirdPartyAssetURL method for Mat…
Browse files Browse the repository at this point in the history
…hQuill.

That special handling is no longer needed now that MathQuill is
installed via npm from the npm repositories.  Furthermore, jsdelivr
provides the files from the package that can be used when the
`$options{thirdPartyAssetsUseCDN}` option is set to 1.
  • Loading branch information
drgrice1 committed Nov 11, 2024
1 parent 22b6dbf commit 917732a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/WeBWorK/Utils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -401,13 +401,13 @@ sub readJSON ($fileName) {
sub getThirdPartyAssetURL ($file, $dependencies, $baseURL, $useCDN = 0) {
for (keys %$dependencies) {
if ($file =~ /^node_modules\/$_\/(.*)$/) {
if ($useCDN && $1 !~ /mathquill/) {
if ($useCDN) {
return
"https://cdn.jsdelivr.net/npm/$_\@"
. substr($dependencies->{$_}, 1) . '/'
. ($1 =~ s/(?:\.min)?\.(js|css)$/.min.$1/gr);
} else {
return "$baseURL/$file?version=" . ($dependencies->{$_} =~ s/#/@/gr);
return "$baseURL/$file?version=$dependencies->{$_}";
}
}
}
Expand Down

0 comments on commit 917732a

Please sign in to comment.