diff --git a/scripts/addon-update.ts b/scripts/addon-update.ts index e901b672b..531f0e873 100644 --- a/scripts/addon-update.ts +++ b/scripts/addon-update.ts @@ -13,9 +13,14 @@ import path from 'path'; // @ts-ignore item.description = d.description; // remove html tags from description (e.g. ) - item.description = item.description.replace(/<[^>]*>?/gm, ''); + // CodeQL js/incomplete-multi-character-sanitization + let previous; + do { + previous = item.description; + item.description = item.description.replace(/<[^>]*>?/gm, ''); + } while (item.description !== previous); // remove markdown links from description (e.g. [link](url)) - item.description = item.description.replace(/\[(.*?)\]\(.*?\)/gm, '$1'); + item.description = item.description.trim().replace(/\[(.*?)\]\(.*?\)/gm, '$1'); item.url = `https://www.npmjs.org/${item.name}`; item.registry = `https://registry.npmjs.org/${item.name}`; item.bundled = typeof item.bundled === 'boolean' ? item.bundled : false;