Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/markdown_it/presets/__init__.py: 100%

15 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-07 06:15 +0000

1__all__ = ("commonmark", "default", "zero", "js_default", "gfm_like") 

2 

3from . import commonmark, default, zero 

4from ..utils import PresetType 

5 

6js_default = default 

7 

8 

9class gfm_like: # noqa: N801 

10 """GitHub Flavoured Markdown (GFM) like. 

11 

12 This adds the linkify, table and strikethrough components to CommmonMark. 

13 

14 Note, it lacks task-list items and raw HTML filtering, 

15 to meet the the full GFM specification 

16 (see https://github.github.com/gfm/#autolinks-extension-). 

17 """ 

18 

19 @staticmethod 

20 def make() -> PresetType: 

21 config = commonmark.make() 

22 config["components"]["core"]["rules"].append("linkify") 

23 config["components"]["block"]["rules"].append("table") 

24 config["components"]["inline"]["rules"].extend(["strikethrough", "linkify"]) 

25 config["components"]["inline"]["rules2"].append("strikethrough") 

26 config["options"]["linkify"] = True 

27 config["options"]["html"] = True 

28 return config