From aa3c39f9dabd06d86e4eff4cde12b288cb9f752e Mon Sep 17 00:00:00 2001 From: yanglbme Date: Mon, 20 Dec 2021 20:20:31 +0800 Subject: [PATCH] feat: support custom code style (#117) close #117 --- src/assets/example/theme-css.txt | 3 +++ src/assets/scripts/util.js | 1 + 2 files changed, 4 insertions(+) diff --git a/src/assets/example/theme-css.txt b/src/assets/example/theme-css.txt index 6613633..d1061c0 100644 --- a/src/assets/example/theme-css.txt +++ b/src/assets/example/theme-css.txt @@ -49,3 +49,6 @@ ul { /* 列表项样式 */ li { } +/* 代码块样式 */ +code { +} diff --git a/src/assets/scripts/util.js b/src/assets/scripts/util.js index 44b48f8..6f8f189 100644 --- a/src/assets/scripts/util.js +++ b/src/assets/scripts/util.js @@ -57,6 +57,7 @@ export function customCssWithTemplate(jsonString, color, theme) { customTheme.block.h2 = Object.assign(customTheme.block.h2, jsonString.h2); customTheme.block.h3 = Object.assign(customTheme.block.h3, jsonString.h3); customTheme.block.h4 = Object.assign(customTheme.block.h4, jsonString.h4); + customTheme.block.code = Object.assign(customTheme.block.code, jsonString.code); customTheme.block.p = Object.assign(customTheme.block.p, jsonString.p); customTheme.block.hr = Object.assign(customTheme.block.hr, jsonString.hr); customTheme.block.blockquote = Object.assign(