Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

默认情况下{{ post.html | safe }}会将代码段渲染成模式,但是高亮代码却需要<pre></pre>,有什么好的解决方法吗


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
349 views
Welcome To Ask or Share your Answers For Others

1 Answer

不知道你用的是什么markdown库,如果用的是一个markdown的库,它是不支持用```(反引号)插入代码块的,你用反引号插入的代码会被放在一行挤成一块,想插入代码块要用缩进来插入,关于这个问题,我在Github上面问过《Flask Web开发》那本书的作者:https://github.com/miguelgrin...,你可以换一个库,我用的是misaka,我的代码在这里:https://github.com/zhengguanj...,可以参考一下


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...