Fix markdown bug

This commit is contained in:
cuom1999 2022-11-08 15:11:45 -06:00
parent 139cb93811
commit 924f209311

View file

@ -82,7 +82,8 @@ def markdown(value, lazy_load=False):
if lazy_load:
soup = BeautifulSoup(html, features="lxml")
for img in soup.findAll("img"):
img["data-src"] = img["src"]
img["src"] = ""
if img.get("src"):
img["data-src"] = img["src"]
img["src"] = ""
html = str(soup)
return '<div class="md-typeset">%s</div>' % html