Aggiorna la versione a 1.1.001 e migliora la regex per il matching del testo del corso

This commit is contained in:
Luigi D'Acunto 2025-06-07 19:22:57 +02:00
parent 4809fc8676
commit 531e9830a8

View file

@ -5,7 +5,7 @@
// @downloadURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/GAIA-Swissknife.user.js
// @changelogURL https://luigidacunto.com/scripts/gaia-swissknife/tampermonkey-script/CHANGELOG.md
// @author Luigi D'Acunto
// @version 1.1.0
// @version 1.1.001
// @description Aggiunge funzionalità alle pagine di GAIA
// @match https://gaia.cri.it/*
// @require https://code.jquery.com/jquery-3.6.0.min.js
@ -413,7 +413,7 @@ GM_addStyle(GM_getResourceText("DataTablesCSS"));
if ($corsoLink.length === 0) return; // blocco non relativo a richiesta corso
const corsoText = $corsoLink.text().trim();
const match = corsoText.match(/([A-Z]{3,}\/\d{4}\/[A-Z]+\/\d+)/);
const match = corsoText.match(/([A-Z]{3,}\/\d{4}\/[A-Z]+(?: [A-Z]+)?\/\d+)/);
if (!match) return;
const codiceCorso = match[1];