
1 013231 Aug 25, 2013 text = u'# 大标题 ## 第二号 ... ' result = markdown.markdown(text) |
2 013231 Aug 25, 2013 或者: # encoding=utf8 text = '# 大标题 ## 第二号 ... ' result = markdown.markdown(text.decode('utf-8')) |
3 liushuaikobe Aug 25, 2013 正好之前有用到过这个库做过一个小项目,你可以去参考下: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 |