~sircmpwn/core.sr.ht

ac6cc21251d91a150092322ffa8f0c02c5eada98 — Drew DeVault 2 months ago 0668359 0.68.22
Revert "Fix bleach sanitizing imports"

This is not compatible with prior versions of bleach.

This reverts commit 066835900f6439d2d215d05a1ed745c4c32f7848.
1 files changed, 2 insertions(+), 3 deletions(-)

M srht/markdown.py
M srht/markdown.py => srht/markdown.py +2 -3
@@ 7,7 7,6 @@ from pygments.formatters import HtmlFormatter, ClassNotFound
from pygments.lexers import get_lexer_by_name
from urllib.parse import urlparse, urlunparse
import bleach
import bleach.css_sanitizer
import html
import mistletoe as m
from mistletoe.span_token import SpanToken, RawText


@@ 178,12 177,12 @@ _sanitizer = bleach.sanitizer.Cleaner(
        'matrix',
        'xmpp',
    ],
    css_sanitizer=bleach.css_sanitizer.CSSSanitizer(allowed_svg_properties=[], allowed_css_properties=[
    styles=bleach.sanitizer.ALLOWED_STYLES + [
        "margin", "padding",
        "text-align", "font-weight", "text-decoration"
    ]
    + [f"padding-{p}" for p in ["left", "right", "bottom", "top"]]
    + [f"margin-{p}"  for p in ["left", "right", "bottom", "top"]]),
    + [f"margin-{p}"  for p in ["left", "right", "bottom", "top"]],
    strip=True)

def sanitize(html):