0
在python中有一个markdown扩展,它突出显示codehilite的代码。该扩展将代码片段包装在codehilite类中。我怎样才能得到这样的功能,但只在每个片段上放置class ='prettyprint'而不用codehilite处理。在Python中使用prettyprint类包装markdown代码块
基本上为什么不使用str.replace()
或 're.subn()' 每<pre></pre>
标记,降价使得进入<pre class='prettyprint'></pre>
因为我使用的模板 – Supremekhaoz
如果meen Django的模板,那就没办法那么这是没有问题的。只需使用'render_to_string()'https://docs.djangoproject.com/en/1.5/ref/templates/api/#the-render-to-string-shortcut – twil