Skip to content

Commit

Permalink
fix: missing file extension in downloaded font (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
bopazyn committed Apr 8, 2024
1 parent 9464679 commit ce15252
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/css-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ export class CssParser {
const filename = url.match(this.googleFontsFileRegex)?.[1]?.toString();

if (filename) {
fonts.set(filename + '.woff2', {
const filenameWithExtension = filename + '.woff2';
fonts.set(filenameWithExtension, {
url,
filename,
localPath: base + (assetsDir ? assetsDir + '/' : '') + filename + '.woff2',
filename: filenameWithExtension,
localPath: base + (assetsDir ? assetsDir + '/' : '') + filenameWithExtension,
});
}
}
Expand Down

0 comments on commit ce15252

Please sign in to comment.