Skip to content

Commit 90059bf

Browse files
authored
acually enable img_with_alt flag
1 parent d0df9a9 commit 90059bf

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

app.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
mf2py.Parser.user_agent = "python.microformats.io (mf2py/" + mf2py.__version__ + ") Mozilla/5.0 Chrome/29.0.1547.57 Safari/537.36"
2525
mf2py.Parser.dict_class = OrderedDict
26-
mf2py.Parser.img_with_alt = True
2726

2827
@app.route("/", methods=["GET", "POST"])
2928
def index():
@@ -39,13 +38,13 @@ def index():
3938
def fetch_mf2(url):
4039
if url in cached_mf2:
4140
return cached_mf2[url]
42-
p = mf2py.parse(url=url, html_parser=parser or None)
41+
p = mf2py.parse(url=url, html_parser=parser or None, img_with_alt = True)
4342
cached_mf2[url] = p
4443
return p
4544

4645
if url or doc:
4746
p = mf2py.parse(
48-
url=url or None, doc=doc or None, html_parser=parser or None
47+
url=url or None, doc=doc or None, html_parser=parser or None, img_with_alt = True
4948
)
5049
if util:
5150
if any("h-feed" in item["type"] for item in p["items"]):

0 commit comments

Comments
 (0)