1
013231 2013-08-25 04:22:34 +08:00 ![]() text = u'# 大标题 ## 第二号 ... '
result = markdown.markdown(text) |
2
013231 2013-08-25 04:26:23 +08:00
或者:
# encoding=utf8 text = '# 大标题 ## 第二号 ... ' result = markdown.markdown(text.decode('utf-8')) |
![]() |
3
liushuaikobe 2013-08-25 09:56:11 +08:00 ![]() 正好之前有用到过这个库做过一个小项目,你可以去参考下:https://github.com/liushuaikobe/evermd
# Markdown only accepts unicode input! text = '# 大标题 ## 第二号 ... ' md = unicode(text, 'utf-8') markdown.markdown(md).encode('utf-8') |
![]() |
4
kingseven OP |