From 90059bf8a87e0d15ff8ebe424f83ecd755eff168 Mon Sep 17 00:00:00 2001 From: Sven Date: Fri, 9 Dec 2022 00:00:24 +0100 Subject: [PATCH] acually enable img_with_alt flag --- app.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app.py b/app.py index 3ea2723..c2a370e 100644 --- a/app.py +++ b/app.py @@ -23,7 +23,6 @@ mf2py.Parser.user_agent = "python.microformats.io (mf2py/" + mf2py.__version__ + ") Mozilla/5.0 Chrome/29.0.1547.57 Safari/537.36" mf2py.Parser.dict_class = OrderedDict -mf2py.Parser.img_with_alt = True @app.route("/", methods=["GET", "POST"]) def index(): @@ -39,13 +38,13 @@ def index(): def fetch_mf2(url): if url in cached_mf2: return cached_mf2[url] - p = mf2py.parse(url=url, html_parser=parser or None) + p = mf2py.parse(url=url, html_parser=parser or None, img_with_alt = True) cached_mf2[url] = p return p if url or doc: p = mf2py.parse( - url=url or None, doc=doc or None, html_parser=parser or None + url=url or None, doc=doc or None, html_parser=parser or None, img_with_alt = True ) if util: if any("h-feed" in item["type"] for item in p["items"]):