Согласно их вики, следует добавить класс html
Код: Выделить всё
# Code goes here ...Но, судя по попыткам моего переводчика, это не работает;
Код: Выделить всё
In [9]: markdown.version
Out[9]: '2.3.1'
In [10]: text = """:::python
....: import os
....: print "This is a text!"
....: """
In [11]: html = markdown.markdown(text, extensions=['codehilite'])
In [12]: html
Out[12]: u'
:::python\nimport os\nprint "This is a text!"
'
In [13]: # Even more funnier, when following the examples in the usage section "..['codehilite(linenums=True)']
In [14]: html = markdown.markdown(text, extensions=['codehilite(linenums=True)'])
In [15]: html
Out[15]: u'
:::python\nimport os\nprint "This is a text!"
'
In [16]: # No line numbers, or any class..
Ожидаемым результатом будет то, что Markdown добавит html-класс codehilite, чтобы я смог заставить работать синтаксис.
В чем здесь проблема? п>
Подробнее здесь: https://stackoverflow.com/questions/165 ... codehilite
Мобильная версия