# Path: readme_renderer/clean.py
# def clean(html, tags=None, attributes=None, styles=None):
#     if tags is None:
#         tags = ALLOWED_TAGS
#     if attributes is None:
#         attributes = ALLOWED_ATTRIBUTES
#     if styles is None:
#         styles = ALLOWED_STYLES
# 
#     # Clean the output using Bleach
#     cleaner = bleach.sanitizer.Cleaner(
#         tags=tags,
#         attributes=attributes,
#         styles=styles,
#         filters=[
#             # Bleach Linkify makes it easy to modify links, however, we will
#             # not be using it to create additional links.
#             functools.partial(
#                 bleach.linkifier.LinkifyFilter,
#                 callbacks=[
#                     lambda attrs, new: attrs if not new else None,
#                     bleach.callbacks.nofollow,
#                 ],
#                 skip_tags=["pre"],
#                 parse_email=False,
#             ),
#             DisabledCheckboxInputsFilter,
#         ],
#     )
#     try:
#         cleaned = cleaner.clean(html)
#         return cleaned
#     except ValueError:
#         return None


import re
import warnings
import pygments
import pygments.lexers
import pygments.formatters
    import cmarkgfm
from html.parser import unescape
from .clean import clean
    from cmarkgfm.cmark import Options as cmarkgfmOptions
            raw, options=cmarkgfmOptions.CMARK_OPT_UNSAFE
        ),
    }
except ImportError:
    warnings.warn(_EXTRA_WARNING)
    variants = {}

# Make code fences with `python` as the language default to highlighting as
# Python 3.
_LANG_ALIASES = {
    'python': 'python3',
}


def render(raw, variant="GFM", **kwargs):
    if not variants:
        warnings.warn(_EXTRA_WARNING)
        return None

    renderer = variants.get(variant)

    if not renderer:
        return None

    rendered = renderer(raw)

    if not rendered:
        return None

    highlighted = _highlight(rendered)

# Path: readme_renderer/clean.py
# def clean(html, tags=None, attributes=None, styles=None):
#     if tags is None:
#         tags = ALLOWED_TAGS
#     if attributes is None:
#         attributes = ALLOWED_ATTRIBUTES
#     if styles is None:
#         styles = ALLOWED_STYLES
# 
#     # Clean the output using Bleach
#     cleaner = bleach.sanitizer.Cleaner(
#         tags=tags,
#         attributes=attributes,
#         styles=styles,
#         filters=[
#             # Bleach Linkify makes it easy to modify links, however, we will
#             # not be using it to create additional links.
#             functools.partial(
#                 bleach.linkifier.LinkifyFilter,
#                 callbacks=[
#                     lambda attrs, new: attrs if not new else None,
#                     bleach.callbacks.nofollow,
#                 ],
#                 skip_tags=["pre"],
#                 parse_email=False,
#             ),
#             DisabledCheckboxInputsFilter,
#         ],
#     )
#     try:
#         cleaned = cleaner.clean(html)
#         return cleaned
#     except ValueError:
#         return None


# Path: readme_renderer/markdown.py
import re
import warnings
import pygments
import pygments.lexers
import pygments.formatters
    import cmarkgfm
from html.parser import unescape
from .clean import clean
    from cmarkgfm.cmark import Options as cmarkgfmOptions

            raw, options=cmarkgfmOptions.CMARK_OPT_UNSAFE
        ),
    }
except ImportError:
    warnings.warn(_EXTRA_WARNING)
    variants = {}

# Make code fences with `python` as the language default to highlighting as
# Python 3.
_LANG_ALIASES = {
    'python': 'python3',
}


def render(raw, variant="GFM", **kwargs):
    if not variants:
        warnings.warn(_EXTRA_WARNING)
        return None

    renderer = variants.get(variant)

    if not renderer:
        return None

    rendered = renderer(raw)

    if not rendered:
        return None

    highlighted = _highlight(rendered)

    cleaned = clean(highlighted)