Closed weaming closed 8 years ago
Did you enable the fenced codeblock extension?
misaka.html(text, extensions=('fenced-code',))
Or:
misaka.Markdown(renderer, extensions=('fenced-code',))
@FSX Can I set the default extensions value of this method to 'fenced-code'? Because I want to use:
md = misaka.html
md(text)
But don't want to change the md(text)
part.
You mean this?
renderer = misaka.HtmlRenderer()
md = misaka.Markdown(renderer, extensions=('fenced-code',))
md(text)
Please read the documentation: http://misaka.61924.nl/
@FSX I think yes.Thanks very much for your reply. I will try it later.
The documentation is not accessed easily in China for the net reason, and the domain is so strange.
I see, you can also build the documentation yourself.
Go into the docs
folder and run make html
. A _build
folder is created containing the HTML files.
@FSX It occured a EROOR:
File "/data1/www/htdocs/462/codelog/1/handlers/content_handler.py", line 5, in <module>
md = misaka.Markdown(renderer, extensions=('fenced-code',))
File "misaka.pyx", line 194, in misaka.Markdown.__cinit__ (src/misaka.c:1481)
TypeError: an integer is required
I'm using misaka 1.0.2
I had fix this using the misaka.EXT_FENCED_CODE
.
But another problem appeared...
In version 1.0.2, must use render()
function. ^_^
from misaka import Markdown, HtmlRenderer
rndr = HtmlRenderer()
md = Markdown(rndr)
print md.render('some text')
Yes, I've changed it in version 2.
@FSX You can visit my demo blog site http://codelog.sinaapp.com/
can't process code block surrounded with ``` such as