• Stars
    star
    2,323
  • Rank 18,976 (Top 0.4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created about 10 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A fast yet powerful Python Markdown parser with renderers and plugins.

Mistune v3

A fast yet powerful Python Markdown parser with renderers and plugins.

Coverage

NOTE: This is the re-designed v3 of mistune.

Looking for old Mistune? Switch branch to:

  • v1
  • v2

Paid plugins

You can ask me to create a custom mistune plugin or directive for your needs with GitHub sponsor one time tier (Mistune enhance)

Sponsors

Mistune is sponsored by Typlog, a blogging and podcast hosting platform, simple yet powerful. Write in Markdown.

Support Me via GitHub Sponsors.

Install

To install mistune:

$ pip install mistune

Overview

Convert Markdown to HTML with ease:

import mistune

mistune.html(your_markdown_text)

Security Reporting

If you found security bugs, please do not send a public issue or patch. You can send me email at [email protected]. Attachment with patch is welcome. My PGP Key fingerprint is:

72F8 E895 A70C EBDF 4F2A DFE0 7E55 E3E0 118B 2B4C

Or, you can use the Tidelift security contact. Tidelift will coordinate the fix and disclosure.

Benchmarks

Here is the benchmark score on my computer. Check the benchmark/bench.py script.

mistune (3.0.0) - atx: 13.901472091674805ms
mistune (slow) - atx: 13.122797012329102ms
mistune (fast) - atx: 13.248443603515625ms
mistune (full) - atx: 15.445232391357422ms
markdown (3.3.7) - atx: 48.41303825378418ms
markdown2 (2.4.3) - atx: 379.30870056152344ms
mistletoe (0.8.2) - atx: 25.46215057373047ms
markdown_it (2.1.0) - atx: 42.37723350524902ms
mistune (3.0.0) - setext: 8.43048095703125ms
mistune (slow) - setext: 8.97979736328125ms
mistune (fast) - setext: 8.122920989990234ms
mistune (full) - setext: 9.525299072265625ms
markdown (3.3.7) - setext: 30.74812889099121ms
markdown2 (2.4.3) - setext: 218.90878677368164ms
mistletoe (0.8.2) - setext: 20.46680450439453ms
markdown_it (2.1.0) - setext: 27.010202407836914ms
mistune (3.0.0) - normal_ul: 60.910940170288086ms
mistune (slow) - normal_ul: 59.69667434692383ms
mistune (fast) - normal_ul: 60.41216850280762ms
mistune (full) - normal_ul: 62.89219856262207ms
markdown (3.3.7) - normal_ul: 83.7857723236084ms
markdown2 (2.4.3) - normal_ul: 175.36139488220215ms
mistletoe (0.8.2) - normal_ul: 74.82385635375977ms
markdown_it (2.1.0) - normal_ul: 103.0113697052002ms
mistune (3.0.0) - insane_ul: 104.1865348815918ms
mistune (slow) - insane_ul: 105.83090782165527ms
mistune (fast) - insane_ul: 103.03664207458496ms
mistune (full) - insane_ul: 105.80086708068848ms
markdown (3.3.7) - insane_ul: 133.82673263549805ms
markdown2 (2.4.3) - insane_ul: 337.23902702331543ms
mistletoe (0.8.2) - insane_ul: 122.10249900817871ms
markdown_it (2.1.0) - insane_ul: 85.92629432678223ms
mistune (3.0.0) - normal_ol: 25.092601776123047ms
mistune (slow) - normal_ol: 25.321483612060547ms
mistune (fast) - normal_ol: 25.11453628540039ms
mistune (full) - normal_ol: 25.945663452148438ms
markdown (3.3.7) - normal_ol: 43.30158233642578ms
markdown2 (2.4.3) - normal_ol: 75.87885856628418ms
mistletoe (0.8.2) - normal_ol: 33.63537788391113ms
markdown_it (2.1.0) - normal_ol: 40.307044982910156ms
mistune (3.0.0) - insane_ol: 46.201229095458984ms
mistune (slow) - insane_ol: 49.14569854736328ms
mistune (fast) - insane_ol: 45.96853256225586ms
mistune (full) - insane_ol: 47.544002532958984ms
markdown (3.3.7) - insane_ol: 50.154924392700195ms
markdown2 (2.4.3) - insane_ol: 210.48712730407715ms
mistletoe (0.8.2) - insane_ol: 84.07974243164062ms
markdown_it (2.1.0) - insane_ol: 83.61554145812988ms
mistune (3.0.0) - blockquote: 15.484809875488281ms
mistune (slow) - blockquote: 16.12544059753418ms
mistune (fast) - blockquote: 15.350818634033203ms
mistune (full) - blockquote: 16.104936599731445ms
markdown (3.3.7) - blockquote: 63.04144859313965ms
markdown2 (2.4.3) - blockquote: 702.4445533752441ms
mistletoe (0.8.2) - blockquote: 28.56159210205078ms
markdown_it (2.1.0) - blockquote: 37.35041618347168ms
mistune (3.0.0) - blockhtml: 7.898569107055664ms
mistune (slow) - blockhtml: 7.080316543579102ms
mistune (fast) - blockhtml: 7.414340972900391ms
mistune (full) - blockhtml: 8.559703826904297ms
markdown (3.3.7) - blockhtml: 46.65660858154297ms
markdown2 (2.4.3) - blockhtml: 122.09773063659668ms
mistletoe (0.8.2) - blockhtml: 12.23611831665039ms
markdown_it (2.1.0) - blockhtml: 26.836156845092773ms
mistune (3.0.0) - fenced: 4.281282424926758ms
mistune (slow) - fenced: 4.092931747436523ms
mistune (fast) - fenced: 4.024267196655273ms
mistune (full) - fenced: 4.453897476196289ms
markdown (3.3.7) - fenced: 33.83779525756836ms
markdown2 (2.4.3) - fenced: 92.49091148376465ms
mistletoe (0.8.2) - fenced: 9.19342041015625ms
markdown_it (2.1.0) - fenced: 12.503623962402344ms
mistune (3.0.0) - paragraph: 95.94106674194336ms
mistune (slow) - paragraph: 561.2788200378418ms
mistune (fast) - paragraph: 93.597412109375ms
mistune (full) - paragraph: 110.09836196899414ms
markdown (3.3.7) - paragraph: 304.1346073150635ms
markdown2 (2.4.3) - paragraph: 267.84825325012207ms
mistletoe (0.8.2) - paragraph: 779.3235778808594ms
markdown_it (2.1.0) - paragraph: 825.5178928375244ms
mistune (3.0.0) - emphasis: 23.591041564941406ms
mistune (slow) - emphasis: 16.934871673583984ms
mistune (fast) - emphasis: 23.232460021972656ms
mistune (full) - emphasis: 25.2840518951416ms
markdown (3.3.7) - emphasis: 76.50399208068848ms
markdown2 (2.4.3) - emphasis: 9.393930435180664ms
mistletoe (0.8.2) - emphasis: 33.68663787841797ms
markdown_it (2.1.0) - emphasis: 60.90521812438965ms
mistune (3.0.0) - auto_links: 3.7980079650878906ms
mistune (slow) - auto_links: 3.3910274505615234ms
mistune (fast) - auto_links: 3.6630630493164062ms
mistune (full) - auto_links: 3.9186477661132812ms
markdown (3.3.7) - auto_links: 23.04673194885254ms
markdown2 (2.4.3) - auto_links: 6.537914276123047ms
mistletoe (0.8.2) - auto_links: 8.360624313354492ms
markdown_it (2.1.0) - auto_links: 19.732236862182617ms
mistune (3.0.0) - std_links: 21.920442581176758ms
mistune (slow) - std_links: 17.487764358520508ms
mistune (fast) - std_links: 19.87743377685547ms
mistune (full) - std_links: 24.514198303222656ms
markdown (3.3.7) - std_links: 39.1237735748291ms
markdown2 (2.4.3) - std_links: 14.519691467285156ms
mistletoe (0.8.2) - std_links: 22.84979820251465ms
markdown_it (2.1.0) - std_links: 32.60660171508789ms
mistune (3.0.0) - ref_links: 47.673940658569336ms
mistune (slow) - ref_links: 39.449214935302734ms
mistune (fast) - ref_links: 44.81911659240723ms
mistune (full) - ref_links: 52.37579345703125ms
markdown (3.3.7) - ref_links: 87.65625953674316ms
markdown2 (2.4.3) - ref_links: 23.118972778320312ms
mistletoe (0.8.2) - ref_links: 59.136390686035156ms
markdown_it (2.1.0) - ref_links: 80.44648170471191ms
mistune (3.0.0) - readme: 56.607723236083984ms
mistune (slow) - readme: 68.8173770904541ms
mistune (fast) - readme: 53.86018753051758ms
mistune (full) - readme: 61.25998497009277ms
markdown (3.3.7) - readme: 211.02523803710938ms
markdown2 (2.4.3) - readme: 533.4112644195557ms
mistletoe (0.8.2) - readme: 110.12959480285645ms
markdown_it (2.1.0) - readme: 247.9879856109619ms

License

Mistune is licensed under BSD. Please see LICENSE for licensing details.

More Repositories

1

authlib

The ultimate Python library in building OAuth, OpenID Connect clients and servers. JWS,JWE,JWK,JWA,JWT included.
Python
3,619
star
2

editor

A markdown editor. http://lab.lepture.com/editor/
JavaScript
2,784
star
3

github-cards

The unofficial GitHub Cards. Card for your GitHub profile, card for your GitHub repositories.
HTML
2,085
star
4

flask-oauthlib

YOU SHOULD USE https://github.com/lepture/authlib
Python
1,443
star
5

python-livereload

livereload server in python
Python
993
star
6

captcha

A captcha library that generates audio and image CAPTCHAs.
Python
920
star
7

nico

MAINTAINER WANTED!
JavaScript
277
star
8

vui

A UI framework for mobile, built with Vue.
Vue
246
star
9

zerqu

ZERQU is a content-focused API-based platform.
Python
173
star
10

flask-weixin

Weixin implementation in Flask.
Python
148
star
11

vim-jinja

jinja plugins for vim (syntax and indent)
Vim Script
141
star
12

getbook

Generate ebooks from a collection of web links.
Python
108
star
13

flask-turbolinks

Turbolinks for Flask.
Python
80
star
14

tornado.ext

!!!DEACTIVATE!!!
Python
75
star
15

markit

A markdown parser and compiler with custom rendering. Forked from marked.
JavaScript
73
star
16

colorful

colorful environment for command line tools in node
JavaScript
62
star
17

safe

Is your password safe?
Python
62
star
18

shibuya

A responsive, good looking with modern design documentation theme for Sphinx
CSS
59
star
19

opencc-python

OpenCC binding for Python.
Python
52
star
20

selection.js

selection.js provides a clean API to access selection on browser.
JavaScript
52
star
21

terminal

A terminal environment tools for python.
Python
49
star
22

ganam

Yes, it's Ganam Style - a ganam style guide parser. Inspired by kneath's kss.
JavaScript
49
star
23

lepture.com

My website. (It is not powered by Jekyll)
HTML
48
star
24

safe.js

Is your password safe?
JavaScript
47
star
25

july

DEACTIVATE.
Python
47
star
26

tower-slack

ๅฐ† Tower.im ็š„ๆถˆๆฏๅ‘้€ๅˆฐ Slack ไธŠ
Python
46
star
27

chinalaw

่ฏทๅ…ณๆณจ https://github.com/cn
44
star
28

mistune-contrib

Contribution for mistune.
Python
40
star
29

flask-storage

Uploader extension for Flask. [WIP]
Python
35
star
30

getbook-chinese

Python
35
star
31

tornado.third

third party for tornado, see howto at https://github.com/lepture/tornado.ext
Python
35
star
32

social

Share your notes with a beautiful social button.
JavaScript
34
star
33

flask-shorturl

Short URL generator for Flask.
Python
33
star
34

rewatch

Watch and execute command.
JavaScript
30
star
35

dotfiles

my dot files
Python
27
star
36

tforms

Python
24
star
37

dingo

My personal mini Heroku (WIP)
Shell
23
star
38

vino

Vino Is Not ORM [DONT USE IT]
Python
22
star
39

mocha-browser

A mocha test suite for browser.
JavaScript
19
star
40

vim-css

css3 syntax support for vim
Vim Script
18
star
41

StatusBarApp

Demo for Status Bar App
Objective-C
16
star
42

example-oauth1-server

This is an example of OAuth 1 Server.
Python
16
star
43

onepage

Onepage scroll webpage in component.
JavaScript
15
star
44

vim-velocity

velocity syntax for vim
Vim Script
14
star
45

ed

A wysiwyg editor without configuration.
JavaScript
14
star
46

mailship

A solution for shipping emails as cheaper as possible. (WIP)
Go
13
star
47

liquidluck-theme-moment

liquidluck default theme
CSS
12
star
48

Vealous

This project is DEACTIVE
Python
12
star
49

burglar

Let's rob the fat guys, and publish everything into feeds.
Python
12
star
50

pedantmark

Python binding of GitHub CommonMark with extensions and renderers.
Python
12
star
51

pigeon

Sending mails over HTTP.
JavaScript
11
star
52

jekyll-vision

A jekyll theme that once looked like my blog.
CSS
11
star
53

nico-one

the one theme for nico
CSS
11
star
54

feedme

Feeds by Doocer
Python
10
star
55

color-patterns

Colors that I love.
CSS
10
star
56

aiowhoosh

Whoosh over HTTP by aiohttp
Python
8
star
57

flask-alchemy

Flask-Alchemy is designed to work with SQLAlchemy default declarative_base, with powerful master-slave and seprated databases support.
Python
8
star
58

ansible-scrapyd

Ansible role for scrapyd.
8
star
59

caret

Manipulate caret, selection and range.
JavaScript
7
star
60

jsdc-2014

Slide for JSDC TW 2014
JavaScript
7
star
61

sanitize

sanitize html for safety.
JavaScript
7
star
62

pydouban

deactived. see tornado.third instead.
Python
7
star
63

learn-ios-development

Keep the tune of learning.
7
star
64

liquidluck-theme-octopress

octopress theme for Felix Felicis
JavaScript
6
star
65

writeup

Don't use it. This is designed for my own.
Python
6
star
66

ganam-cli

The command line tools for ganam style guide.
JavaScript
6
star
67

github.js

GitHub API in seajs
JavaScript
6
star
68

ebook

ebook library for mobi and epub
Python
5
star
69

markdown-textarea

A <textarea> with markdown toolbar.
JavaScript
5
star
70

format

An easy way for formatting in content editable.
JavaScript
5
star
71

nico-boilerplate

An example for nico blog on GitHub.
Python
5
star
72

og.py

Parse open graph and twitter card from HTML content.
Python
5
star
73

heroku-stripe

My Simple Stripe system on Heroku.
HTML
5
star
74

color-picker

Color picker component.
JavaScript
5
star
75

gaussian-blur

Gaussian blur effect for images.
JavaScript
5
star
76

ipinfo

Query an IP Information.
Python
4
star
77

hentry

Parse hentry from microformats
Python
4
star
78

placeholder

placeholder for contenteditable
JavaScript
4
star
79

semantic-ui

Semantic-UI as a component.
JavaScript
4
star
80

python-wheels

Build my wheels
4
star
81

email-howto

How to write email templates in practice.
CSS
3
star
82

whitepac

Generate whitelist pac for proxy.
JavaScript
3
star
83

removie

Play m3u8
Go
3
star
84

liquidluck-editor

editor server for Felix Felicis
JavaScript
2
star
85

node-vc

change version of a package.json
JavaScript
2
star
86

substitute

A proxy image server
JavaScript
2
star
87

ansible-elasticsearch

Ansible role which manage Elasticsearch 2.x.
2
star
88

init

init: for a simple life [not ready]
Python
2
star
89

book-chenmaoxiu

ไนไธ€่ฉฑไบบ็”Ÿ ้™ณ่Œ‚ไฟฎ่‡ชๅ‚ณ
2
star
90

mistune-renderers

Changed to https://github.com/lepture/mistune-contrib
Python
2
star
91

k-format

Fix keyboard behavior for format.
JavaScript
2
star
92

vue-hammer

Hammer directive for Vue
JavaScript
2
star
93

cordova-plugin-socialkit

Cordova plugin for requesting social services. (WIP)
Objective-C
2
star
94

typlog-coffee

A typlog theme designed by uxcoffee.
CSS
2
star
95

longjing

longjing is a full stack logging system for node.
JavaScript
1
star
96

feedpod

Podcasts by Doocer
Python
1
star
97

docker-bedrock

Bedrock server via Docker
Dockerfile
1
star
98

mardict

just a dict bot
Python
1
star
99

liquidluck

Moved to https://github.com/avelino/liquidluck
HTML
1
star