From 2c26d59d7ca0534dd344bec3056dc94352af8fe0 Mon Sep 17 00:00:00 2001 From: dribble-njr Date: Fri, 22 Nov 2024 13:15:08 +0800 Subject: [PATCH] feat: GFM alerts support custom css --- src/utils/MDAlert.ts | 5 ----- src/utils/index.ts | 12 ++++++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/utils/MDAlert.ts b/src/utils/MDAlert.ts index 0d6f751..03108c4 100644 --- a/src/utils/MDAlert.ts +++ b/src/utils/MDAlert.ts @@ -51,11 +51,6 @@ export default function markedAlert(options: AlertOptions = {}): MarkedExtension }, }) - console.log({ - ...options.theme?.block[className], - ...options.theme?.block[`${className}-${variantType}`], - }, `style`) - const firstLine = token.tokens?.[0] as Tokens.Paragraph const firstLineText = firstLine.raw?.replace(typeRegexp, ``).trim() diff --git a/src/utils/index.ts b/src/utils/index.ts index a18c86c..c072d38 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -34,7 +34,7 @@ export function customizeTheme(theme: Theme, options: { export function customCssWithTemplate(jsonString: Partial>, color: string, theme: Theme) { const newTheme = customizeTheme(theme, { color }) - const mergeProperties = (target: Record, source: Partial>, keys: T[]) => { + const mergeProperties = (target: Record, source: Partial>, keys: T[]) => { keys.forEach((key) => { if (source[key]) { target[key] = Object.assign(target[key] || {}, source[key]) @@ -42,7 +42,7 @@ export function customCssWithTemplate(jsonString: Partial