Skip to content

Commit 2c70017

Browse files
committed
Fix pre code display
1 parent 992c3e9 commit 2c70017

File tree

3 files changed

+23
-29
lines changed

3 files changed

+23
-29
lines changed

static/css/main.css

+2-2
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,9 @@ h1.br-nav, h2.br-nav, h3.br-nav, h4.br-nav {color:#777;font-size: 1em;font-weigh
126126
background: #f5f5f5;
127127
padding: .3em;
128128
border-radius: 4px;
129-
opacity: 0.6;
129+
opacity: 0.98;
130130
}
131+
.markdown-body .pre-container code {white-space: pre;}
131132
.copy-btn {
132133
position: absolute;
133134
top: 8px;
@@ -696,7 +697,6 @@ figure .highlight .s1 {color: #2aa198}
696697
padding: 0 0.3em;
697698
margin: -2px 4px;
698699
}
699-
700700
/* md ed */
701701

702702
.write-box {margin: 0;background-color: #FCFCFC;}

views/ybs/topic_detail.qtpl

+2-5
Original file line numberDiff line numberDiff line change
@@ -326,11 +326,8 @@ if(audioLst.length>1){
326326
function setCopyBtn(){
327327
// 遍历所有pre元素
328328
document.querySelectorAll('pre').forEach(pre => {
329-
// 创建容器包裹pre元素
330-
const container = document.createElement('div');
331-
container.className = 'pre-container';
332-
pre.parentNode.insertBefore(container, pre);
333-
container.appendChild(pre);
329+
const container = pre.parentNode;
330+
container.classList.add('pre-container');
334331

335332
// 创建复制按钮
336333
const btn = document.createElement('button');

views/ybs/topic_detail.qtpl.go

+19-22
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)