添加css
/* 可选:隐藏 DeepSeek 按钮,防止 JS 执行前闪现 */
.article-content [class*="ds-button"],
.article-content [class*="code-info"] {
display: none !important;
}
/* 但保留我们自己的复制按钮 */
.article-content .ry-copy-btn {
display: block !important;
}然后示例如下:
外部按钮的典型结构为:
<div class="ds-button ..."> <div class="ds-button_background"></div> <div class="ds-button_icon"></div> <span class="ds-button_content"> <span class="code-info-button-text">复制</span> </span> </div>
解决方案
1. 修改CSS,增加隐藏这些DeepSeek按钮的规则
在article.php的<style>内或header.php的<style>中添加:
/* 隐藏DeepSeek等外部复制/下载按钮(基于常见类名) */ .article-content .ds-button, .article-content .code-info-button, .article-content [class*="code-info-button"], .article-content [class*="copy-btn"], .article-content [class*="download-btn"], .article-content [class*="ds-"]:has(.code-info-button-text) { display: none !important; }
更稳妥的方式:直接隐藏所有包含“复制”文本且不是.ry-copy-btn的元素(不依赖标签):
.article-content :not(.ry-copy-btn):not(.ry-copy-btn *) { display: none !important; } /* 但这样会误伤,所以只针对疑似按钮区域 */
建议采用类名过滤:
/* 隐藏任何class包含"ds-"或"code-info"的div/span,且位于.article-content内 */ .article-content [class*="ds-"], .article-content [class*="code-info"] { display: none !important; }
发表评论 (0)
留下你的足迹