Lazy load iframe
This commit is contained in:
parent
f6b16a30ac
commit
7150718a51
2 changed files with 9 additions and 1 deletions
|
@ -85,5 +85,10 @@ def markdown(value, lazy_load=False):
|
|||
if img.get("src"):
|
||||
img["data-src"] = img["src"]
|
||||
img["src"] = ""
|
||||
for img in soup.findAll("iframe"):
|
||||
if img.get("src"):
|
||||
img["data-src"] = img["src"]
|
||||
img["src"] = ""
|
||||
html = str(soup)
|
||||
|
||||
return '<div class="md-typeset">%s</div>' % html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue