-
Notifications
You must be signed in to change notification settings - Fork 74
/
Copy path__init__.py
28 lines (21 loc) · 970 Bytes
/
__init__.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
__all__ = ("commonmark", "default", "zero", "js_default", "gfm_like")
from . import commonmark, default, zero
from ..utils import PresetType
js_default = default
class gfm_like: # noqa: N801
"""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() -> PresetType:
config = commonmark.make()
config["components"]["core"]["rules"].append("linkify")
config["components"]["block"]["rules"].append("table")
config["components"]["inline"]["rules"].extend(["strikethrough", "linkify"])
config["components"]["inline"]["rules2"].append("strikethrough")
config["options"]["linkify"] = True
config["options"]["html"] = True
return config