From fba77cd02167589cbf49c184fd723745110bcf7a Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 7 Oct 2024 12:05:04 -0500 Subject: [PATCH] Remove the special case in the `getThirdPartyAssetURL` method for MathQuill. 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. --- lib/WeBWorK/Utils.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/WeBWorK/Utils.pm b/lib/WeBWorK/Utils.pm index 515f7d6de4..5065fe82d7 100644 --- a/lib/WeBWorK/Utils.pm +++ b/lib/WeBWorK/Utils.pm @@ -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->{$_}"; } } }