File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -140,7 +140,16 @@ async function copy() {
140140
141141 setTimeout (() => {
142142 nextTick (async () => {
143- await processClipboardContent (primaryColor .value )
143+ try {
144+ await processClipboardContent (primaryColor .value )
145+ }
146+ catch (error ) {
147+ toast .error (` 处理 HTML 失败,请联系开发者。${normalizeErrorMessage (error )} ` )
148+ editorRefresh ()
149+ emit (` endCopy ` )
150+ return
151+ }
152+
144153 const clipboardDiv = document .getElementById (` output ` )
145154
146155 if (! clipboardDiv ) {
Original file line number Diff line number Diff line change @@ -253,6 +253,9 @@ function mergeCss(html: string): string {
253253 return juice ( html , {
254254 inlinePseudoElements : true ,
255255 preserveImportant : true ,
256+ // 禁用 CSS 变量解析,避免 juice 处理时的错误
257+ // 新主题系统已通过 postcss 处理 CSS 变量
258+ resolveCSSVariables : false ,
256259 } )
257260}
258261
You can’t perform that action at this time.
0 commit comments