From 24b84a6085aac663d262bfbfa480071cc586423f Mon Sep 17 00:00:00 2001 From: wangshiting Date: Thu, 1 Jun 2023 09:48:07 +0800 Subject: [PATCH] fix(plugin-comments): could not build correctly --- .../src/client/styles/giscus-theme-dark.css | 4 ++-- .../plugin-comments/src/client/styles/giscus-theme.css | 4 ++-- .../plugin-comments/src/node/commentsPlugin.ts | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme-dark.css b/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme-dark.css index a380d607..f15b4b47 100644 --- a/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme-dark.css +++ b/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme-dark.css @@ -1,4 +1,4 @@ -/*giscus-theme-dark-start*/ +/*!giscus-theme-dark-start*/ main { --color-prettylights-syntax-comment: #8b949e; --color-prettylights-syntax-constant: #79c0ff; @@ -189,4 +189,4 @@ main .gsc-loading-image { .gsc-comment-author img { @apply rounded !important; } -/*giscus-theme-dark-end*/ \ No newline at end of file +/*!giscus-theme-dark-end*/ \ No newline at end of file diff --git a/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme.css b/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme.css index b42d9ff8..c44a6b7c 100644 --- a/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme.css +++ b/packages/@vuepress-reco/plugin-comments/src/client/styles/giscus-theme.css @@ -1,4 +1,4 @@ -/*giscus-theme-light-start*/ +/*!giscus-theme-light-start*/ .gsc-main { --color-prettylights-syntax-comment: #6e7781; --color-prettylights-syntax-constant: #0550ae; @@ -188,4 +188,4 @@ .gsc-comment-author img { @apply rounded !important; } -/*giscus-theme-light-end*/ \ No newline at end of file +/*!giscus-theme-light-end*/ \ No newline at end of file diff --git a/packages/@vuepress-reco/plugin-comments/src/node/commentsPlugin.ts b/packages/@vuepress-reco/plugin-comments/src/node/commentsPlugin.ts index 7b273f57..8206bfcc 100644 --- a/packages/@vuepress-reco/plugin-comments/src/node/commentsPlugin.ts +++ b/packages/@vuepress-reco/plugin-comments/src/node/commentsPlugin.ts @@ -21,20 +21,20 @@ export const commentsPlugin = (): Plugin => { encoding: 'utf8', }) let lightdarkIndexStart = content.indexOf( - '/*giscus-theme-light-start*/' + '/*!giscus-theme-light-start*/' ) - let lightIndexEnd = content.indexOf('/*giscus-theme-light-end*/') + let lightIndexEnd = content.indexOf('/*!giscus-theme-light-end*/') let darkdarkIndexStart = content.indexOf( - '/*giscus-theme-dark-start*/' + '/*!giscus-theme-dark-start*/' ) - let darkIndexEnd = content.indexOf('/*giscus-theme-dark-end*/') + let darkIndexEnd = content.indexOf('/*!giscus-theme-dark-end*/') const giscusThemeLight = content.substring( lightdarkIndexStart, lightIndexEnd + 27 ) const giscusThemeDark = content.substring( darkdarkIndexStart, - darkIndexEnd + 25 + darkIndexEnd + 26 ) content = content.replace(giscusThemeLight, '') content = content.replace(giscusThemeDark, '')