Init
im going to bed -=-
This commit is contained in:
28
lib/markdown_it/presets/__init__.py
Normal file
28
lib/markdown_it/presets/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
__all__ = ("commonmark", "default", "gfm_like", "js_default", "zero")
|
||||
|
||||
from ..utils import PresetType
|
||||
from . import commonmark, default, zero
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user