博文代码高亮及针对本博客的显示优化(2018.11.16 GitHub Gist)

写了本文后的继续死磕

2018.11.16

行内高亮已于 2018.11.13 加入默认 css,用 <code></code> tag 围起来就可以了。

一劳永逸的多行高亮解决法:GitHub Gist
本文到这里就停止更新了(大概)
<div
style=
"background: #ffffff;
overflow:auto;
width:auto;
border:solid gray;
border-width:.1em .1em .1em .8em;
padding:.2em 1em;">
<table><tr>
<td>
<pre style="margin: 0; line-height: 125%">1</pre>
</td>
<td>
<pre style="margin: 0; line-height: 125%">print &#39;hello world!&#39;</pre>
</td>
</tr></table>
</div>



高亮工具:hilite.me
注意:贴了代码后就不可以再转回 WYSIWYG 编辑器了,必须留在 html 编辑器。

优化规则:
  1. 超过 10 行的,在行号 1 前面插入 &nbsp;
  2. 表格第一行 <td>中的 <pre style> 的 margin 改成 0 1em 0 0,不足 10 行的改成 0 1em 0 0.5em
  3. 代码缩进:&emsp;

inline code beautifier(2018.11.13 已加入默认 css):