hexo-theme-ace
hexo-theme-ace copied to clipboard
关于post-content-preview带有大串数字时,显示到右侧的问题
当笔记正文带有代码块时,会自动生成行号。
layout/index.ejs的post-content-preview,是通过
truncate(strip_html(post.content), {length: 200, omission: '......'})
生成的缩略文本。行号会拼成连续的一大串数字。
首页笔记内容缩略的post-content-preview div显示一大串数字时,不会自动换行,导致文本一直延伸到网页最右侧。
对html不熟悉,我直接在 <div class="post-content-preview">
中加上了
style="word-break: break-all;word-wrap: break-word;"
不知道是否有更优雅的做法。
我看到bootstrap的css样式中,其实是已经配置了break-all。
我测试了,最新代码应该不会有问题。你sync一下代码试试看。