Keldos commited on
Commit
d642c73
·
unverified ·
1 Parent(s): 93a3557

优化代码框样式 (#63)

Browse files

(虽然一开始看到还可以这么定义样式我tm都惊了!但是既然川虎哥都这么写了,那我还是改好看一点)
另外发现gradio已经对代码框定义了一些样式,但是可能被浏览器的用户代理样式表覆盖orz

Files changed (1) hide show
  1. ChuanhuChatbot.py +1 -1
ChuanhuChatbot.py CHANGED
@@ -48,7 +48,7 @@ def parse_text(text):
48
  count += 1
49
  items = line.split('`')
50
  if count % 2 == 1:
51
- lines[i] = f'<pre><code class="{items[-1]}" style="display: block; white-space: pre; padding: 0 1em 1em 1em; color: #fff; background: #000;">'
52
  firstline = True
53
  else:
54
  lines[i] = f'</code></pre>'
 
48
  count += 1
49
  items = line.split('`')
50
  if count % 2 == 1:
51
+ lines[i] = f'<pre><code class="{items[-1]}" style="display: block; white-space: pre; background-color: hsl(0, 0%, 32%); border-radius: 8px; padding: 0px 1em 1em; margin-top: 1em; font-size: initial;">'
52
  firstline = True
53
  else:
54
  lines[i] = f'</code></pre>'