badgen.net icon indicating copy to clipboard operation
badgen.net copied to clipboard

License name of Dart packages are incorrectly shown

Open lastarc opened this issue 2 years ago • 0 comments

In Dart pub section of the website, version name has some additional HTML in it. E.g.:

I think the issue comes from regex on line 105 of the /api/pub.ts file since the HTML of the parsed webpage has changed: https://github.com/badgen/badgen.net/blob/fea19e03ce31204277b0f252ad9268178fe00aa7/api/pub.ts#L103-L107

It might be fixed by updating the regex with /License<\/h3>\s*<p>[^>]+>([^(]+)\(/i:

-      const license = html.match(/License<\/h3>\s*<p>([^(]+)\(/i)?.[1].trim() 
+      const license = html.match(/License<\/h3>\s*<p>[^>]+>([^(]+)\(/i)?.[1].trim() 

lastarc avatar Jun 16 '22 20:06 lastarc