pytilpack.markdown¶
必要なextra
pip install pytilpack[markdown]
pytilpack.markdown
¶
markdown関連。
ALLOWED_TAGS = {'a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'b', 'base', 'basefont', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'br', 'button', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'content', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'header', 'hgroup', 'hr', 'i', 'image', 'img', 'input', 'ins', 'isindex', 'kbd', 'keygen', 'label', 'legend', 'li', 'listing', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'multicol', 'nav', 'nobr', 'noembed', 'noframes', 'noscript', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'plaintext', 'pre', 'progress', 'q', 'rp', 's', 'samp', 'section', 'select', 'shadow', 'small', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'tt', 'u', 'ul', 'var', 'wbr'}
module-attribute
¶
許可するタグ。
ALLOWED_ATTRIBUTES = {'*': ['id', 'title', 'class', 'style'], 'a': ['href', 'alt', 'title', 'target', 'rel'], 'details': ['open'], 'img': ['src', 'alt', 'title', 'width', 'height'], 'td': ['colspan', 'rowspan'], 'th': ['colspan', 'rowspan'], 'tr': ['rowspan']}
module-attribute
¶
許可する属性。
ALLOWED_PROTOCOLS = {'http', 'https', 'mailto'}
module-attribute
¶
許可するプロトコル。
escape(text)
¶
inline_code(text)
¶
テキストをMarkdownのインラインコードブロックに変換。
ソースコード位置: pytilpack/markdown.py
markdownfy(text, extensions=None, extension_configs=None, tab_length=2, sanitize=True, allow_tags=None, allow_attributes=None, allow_protocols=None, strip=False, strip_comments=True, css_sanitizer=None, **kwargs)
¶
Markdown変換。