我在我的 django 项目中使用 python markdown,当我有值时
#/usr/bin/env python
print "this is converted to html code block"
输出是
<pre><code>
#/usr/bin/env python
print "this is converted to html code block"
</code><pre>
现在我的问题是如何将类属性和值传递给代码元素。 示例:
#i should be using some markdown syntax below
[class="python"]
#/usr/bin/env python
print "this is converted to html code block"
然后这里输出
<pre><code class="python">
#/usr/bin/env python
print "this is converted to html code block"
</code><pre>
这可能吗?以及如何?
最佳答案
你可以在 Markdown 中编写 HTML,但你不能添加类和 ids 之类的东西。
参见 this question或 this question了解更多详情。
关于python - 如何将类属性和值传递给 Markdown 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3853620/