From d0e46a31853b10e9d7d73bc5ab19a50b8775b147 Mon Sep 17 00:00:00 2001 From: tianyaxiang Date: Sun, 2 Feb 2025 14:29:47 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20markdown=20=E8=A7=A3?= =?UTF-8?q?=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/config/wechat-templates.ts | 61 +++++++++++----------------------- src/lib/types.ts | 2 ++ 2 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/config/wechat-templates.ts b/src/config/wechat-templates.ts index e8a783d..a54f72e 100644 --- a/src/config/wechat-templates.ts +++ b/src/config/wechat-templates.ts @@ -107,15 +107,6 @@ export const templates: Template[] = [ margin: '0 0 1em 0' }, - // 引用内容 - blockquote_p: { - 'display': `block`, - 'fontSize': `1em`, - 'letterSpacing': `0.1em`, - 'color': `hsl(var(--foreground))`, - }, - - // 代码块 code_pre: { 'fontSize': `14px`, @@ -158,12 +149,26 @@ export const templates: Template[] = [ 'fontSize': `80%`, 'color': `hsl(var(--foreground))`, }, - - figure: { - margin: `1.5em 8px`, - color: `hsl(var(--foreground))`, + + table: { + textAlign: 'center', + margin: '1em 8px', + color: 'hsl(var(--foreground))' }, - + + thead: { + 'background': `rgba(0, 0, 0, 0.05)`, + 'fontWeight': `bold`, + 'color': `hsl(var(--foreground))`, + }, + + td: { + border: '1px solid #dfdfdf', + padding: '0.25em 0.5em', + color: '#3f3f3f', + }, + + }, inline: { listitem: { @@ -190,10 +195,6 @@ export const templates: Template[] = [ color: `#576b95`, }, - wx_link: { - 'color': `#576b95`, - 'textDecoration': `none`, - }, // 字体加粗样式 strong: { @@ -202,33 +203,9 @@ export const templates: Template[] = [ 'fontSize': `inherit`, }, - table: { - textAlign: 'center', - margin: '1em 8px', - color: 'hsl(var(--foreground))' - }, - - thead: { - 'background': `rgba(0, 0, 0, 0.05)`, - 'fontWeight': `bold`, - 'color': `hsl(var(--foreground))`, - }, - - td: { - border: '1px solid #dfdfdf', - padding: '0.25em 0.5em', - color: '#3f3f3f', - }, - footnote: { 'fontSize': `12px`, 'color': `hsl(var(--foreground))`, - }, - - figcaption: { - 'textAlign': `center`, - 'color': `#888`, - 'fontSize': `0.8em`, } } }, diff --git a/src/lib/types.ts b/src/lib/types.ts index 1ac53de..a8d8526 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -101,12 +101,14 @@ export interface RendererOptions { p?: StyleOptions blockquote?: StyleOptions code_pre?: StyleOptions + code?: StyleOptions image?: StyleOptions ul?: StyleOptions ol?: StyleOptions table?: StyleOptions th?: StyleOptions td?: StyleOptions + thead?: StyleOptions footnotes?: StyleOptions } inline?: {