diff --git a/judge/jinja2/markdown/__init__.py b/judge/jinja2/markdown/__init__.py index cf5ab15..e34f74a 100644 --- a/judge/jinja2/markdown/__init__.py +++ b/judge/jinja2/markdown/__init__.py @@ -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 '
%s
' % html diff --git a/resources/common.js b/resources/common.js index 4b13c32..6100cb5 100644 --- a/resources/common.js +++ b/resources/common.js @@ -179,7 +179,10 @@ $(function () { $("[data-src]img").each(function() { $(this).attr("src", $(this).attr("data-src")); }) - }, "500"); + $("[data-src]iframe").each(function() { + $(this).attr("src", $(this).attr("data-src")); + }) + }, "100"); }); if (!Date.now) {