Skip to content

Instantly share code, notes, and snippets.

@lepture
Last active August 29, 2015 14:09
Show Gist options
  • Save lepture/04384d0ab03c056e2536 to your computer and use it in GitHub Desktop.
Save lepture/04384d0ab03c056e2536 to your computer and use it in GitHub Desktop.
# coding: utf-8
import mistune
text = '''hello world
* list item 1
* list item 2
here is a [link](http://lepture.com/)
'''
class NoListLexter(mistune.BlockLexer):
def parse_list_block(self, m):
self.tokens.append({
'type': 'text',
'text': m.group(0),
})
md = mistune.Markdown(block=NoListLexter)
print(md(text))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment