From 1da467d2143a260af8e5b7d2d2f68f0fcaa0260c Mon Sep 17 00:00:00 2001 From: Jacky Zhao Date: Sat, 5 Aug 2023 16:43:50 -0700 Subject: [PATCH] non-admonition callout fix --- quartz/bootstrap-cli.mjs | 6 ++++-- quartz/plugins/transformers/ofm.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/quartz/bootstrap-cli.mjs b/quartz/bootstrap-cli.mjs index 68b9f57..d550aea 100755 --- a/quartz/bootstrap-cli.mjs +++ b/quartz/bootstrap-cli.mjs @@ -16,6 +16,7 @@ import { transform as cssTransform } from "lightningcss" import http from "http" import serveHandler from "serve-handler" import { WebSocketServer } from "ws" +import { randomUUID } from "crypto" const ORIGIN_NAME = "origin" const UPSTREAM_NAME = "upstream" @@ -304,7 +305,8 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started. jsxImportSource: "preact", packages: "external", metafile: true, - sourcemap: true, + sourcemap: "inline", + sourcesContent: false, plugins: [ sassPlugin({ type: "css-text", @@ -372,7 +374,7 @@ See the [documentation](https://quartz.jzhao.xyz) for how to get started. } // bypass module cache - const { default: buildQuartz } = await import(cacheFile + `?update=${new Date()}`) + const { default: buildQuartz } = await import(cacheFile + `?update=${randomUUID()}`) await buildQuartz(argv, clientRefresh) clientRefresh() } diff --git a/quartz/plugins/transformers/ofm.ts b/quartz/plugins/transformers/ofm.ts index 13a32ca..8d8d457 100644 --- a/quartz/plugins/transformers/ofm.ts +++ b/quartz/plugins/transformers/ofm.ts @@ -96,7 +96,7 @@ const calloutMapping: Record = { function canonicalizeCallout(calloutName: string): keyof typeof callouts { let callout = calloutName.toLowerCase() as keyof typeof calloutMapping - return calloutMapping[callout] + return calloutMapping[callout] ?? calloutName } const capitalize = (s: string): string => {