diff options
Diffstat (limited to '')
-rw-r--r-- | markdown_it/presets/__init__.py | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/markdown_it/presets/__init__.py b/markdown_it/presets/__init__.py new file mode 100644 index 0000000..16f10e5 --- /dev/null +++ b/markdown_it/presets/__init__.py @@ -0,0 +1,27 @@ +__all__ = ("commonmark", "default", "zero", "js_default", "gfm_like") + +from . import commonmark, default, zero + +js_default = default + + +class gfm_like: + """GitHub Flavoured Markdown (GFM) like. + + This adds the linkify, table and strikethrough components to CommmonMark. + + Note, it lacks task-list items and raw HTML filtering, + to meet the the full GFM specification + (see https://github.github.com/gfm/#autolinks-extension-). + """ + + @staticmethod + def make(): + config = commonmark.make() + config["components"]["core"]["rules"].append("linkify") + config["components"]["block"]["rules"].append("table") + config["components"]["inline"]["rules"].append("strikethrough") + config["components"]["inline"]["rules2"].append("strikethrough") + config["options"]["linkify"] = True + config["options"]["html"] = True + return config |