From 1313d9b1d866199408c78f10884eab7bad29ec29 Mon Sep 17 00:00:00 2001 From: Ben Schlegel Date: Thu, 7 Mar 2024 20:48:33 +0100 Subject: [PATCH] chore: add explanation to font regex --- quartz/util/imageHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quartz/util/imageHelper.ts b/quartz/util/imageHelper.ts index 183f07f56..1f8272ea0 100644 --- a/quartz/util/imageHelper.ts +++ b/quartz/util/imageHelper.ts @@ -42,7 +42,7 @@ function fetchTtf(fontName: string, weight: FontWeight): Promise { const urlRegex = /url\((https:\/\/fonts.gstatic.com\/s\/.*?.ttf)\)/g const match = urlRegex.exec(css) if (match) { - // fontData is an ArrayBuffer containing the .ttf file data + // fontData is an ArrayBuffer containing the .ttf file data (get match[1] due to google fonts response format, always contains link twice, but second entry is the "raw" link) const fontData = await (await fetch(match[1])).arrayBuffer() resolve(fontData) } else {