From a94da25b96dbea409ab35f90b66edcc4a5129a82 Mon Sep 17 00:00:00 2001 From: dribble-njr Date: Wed, 20 Nov 2024 23:15:31 +0800 Subject: [PATCH] fix: copy to wx lost style --- src/config/theme.ts | 1 + src/utils/MDAlert.ts | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/config/theme.ts b/src/config/theme.ts index 5de9a61..f21cec1 100644 --- a/src/config/theme.ts +++ b/src/config/theme.ts @@ -109,6 +109,7 @@ const defaultTheme: Theme = { 'markdown-alert-title': { 'display': `flex`, 'align-items': `center`, + 'gap': `0.5em`, }, // GFM 警告块内容,抵消 p 默认的 margin diff --git a/src/utils/MDAlert.ts b/src/utils/MDAlert.ts index 9028d2e..e53be83 100644 --- a/src/utils/MDAlert.ts +++ b/src/utils/MDAlert.ts @@ -81,7 +81,7 @@ export default function markedAlert(options: AlertOptions = {}): MarkedExtension name: `alert`, level: `block`, renderer({ meta, tokens = [] }) { - let tmpl = `
\n` + let tmpl = `
\n` tmpl += `

` tmpl += meta.icon.replace( `\n` - tmpl += `

${this.parser.parse(tokens)}
` - tmpl += `
\n` + tmpl += `${this.parser.parse(tokens)}` + tmpl += `\n` return tmpl }, @@ -105,19 +105,19 @@ export default function markedAlert(options: AlertOptions = {}): MarkedExtension const defaultAlertVariant: AlertVariantItem[] = [ { type: `note`, - icon: ``, + icon: ``, }, { type: `tip`, - icon: ``, + icon: ``, }, { type: `important`, - icon: ``, + icon: ``, }, { type: `warning`, - icon: ``, + icon: ``, }, { type: `caution`,