diff --git a/scraper/src/mindtouch2zim/html_rewriting.py b/scraper/src/mindtouch2zim/html_rewriting.py
index ca64b7e..2266bfc 100644
--- a/scraper/src/mindtouch2zim/html_rewriting.py
+++ b/scraper/src/mindtouch2zim/html_rewriting.py
@@ -251,3 +251,27 @@ def rewrite_img_tags(
+ [("src", new_attr_value)]
)
return f"' if auto_close else '>'}"
+
+
+@html_rules.rewrite_tag()
+def rewrite_embed_tags(
+ tag: str,
+ attrs: AttrsList,
+ *,
+ auto_close: bool,
+):
+
+ if tag != "embed":
+ return
+ if not (src_value := get_attr_value_from(attrs, "src")):
+ return # no need to rewrite this embed without src
+
+ # There is 99% chance the embed src is not inside the ZIM, so we assume it is not
+ # (we can't know anyway with current software architecture)
+ return (
+ "This content is not inside the ZIM. "
+ f'View content online at '
+ f"{src_value}"
+ ""
+ f'{ "" if auto_close else "