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