the-dataface / figma2html

Export Figma frames as responsive HTML and CSS
https://www.figma.com/community/plugin/1109185297790825980/figma2html
MIT License
48 stars 8 forks source link

Corrupt Google Fonts URLs #109

Closed lajoiemedia closed 6 months ago

lajoiemedia commented 7 months ago

Describe the bug

The plugin will frequently output corrupt Google Fonts links which include "undefined" in the weight list.

Here is what the resulting JS looks like:

const fontLink = document.createElement('link');
fontLink.rel = 'stylesheet';
fontLink.href = 'https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,600;0,undefined&display=swap';

Note how the weight list contains "undefined".

Reproduction

Not sure exactly what is required to reproduce, except to export a Figma file that contains multiple weights of the Roboto typeface.

Logs

No response

System Info

Figma version 116.17.11, Chrome 123.0.6312.106

Severity

blocking all usage of figma2html

Code of Conduct

sawyerclick commented 6 months ago

Great catch! Fix incoming