diff --git a/themes/chameleon/scripts/copy-button.js b/themes/chameleon/scripts/copy-button.js index 24484d4..e2e48bc 100644 --- a/themes/chameleon/scripts/copy-button.js +++ b/themes/chameleon/scripts/copy-button.js @@ -9,7 +9,7 @@ hexo.extend.filter.register('after_render:html', (data) => { const copyBtn = '' // Regex is based on https://github.com/hexojs/hexo/pull/3697 - return data.replace(/
(?!<\/pre>).+?<\/pre>/ig, (str) => { + return data.replace(/') return str })(?!<\/pre>).+?<\/pre>/gs, (str) => { if (!str.includes(copyBtn)) return str.replace('', copyBtn + '