# Anki 25.02.1 removes embedded \<iframe\> tags and SVG attributes

**URL:** <https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290>\
**Category:** Help\
**Created:** [April 18, 2025, 9:43pm UTC](https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290 "2025-04-18T21:43:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sam-med](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sam-med](https://forums.ankiweb.net/u/sam-med)\
**Post date:** [April 18, 2025, 9:43pm UTC](https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290/1 "2025-04-18T21:43:27Z")

</div>

I recently upgraded from Anki **24.11** to **25.02.1** on Windows.  
Previously, I could embed videos and inline SVGs directly into Basic cards by pasting raw HTML (for example, an `<iframe>` for YouTube or an inline SVG block with custom attributes).  
However, as soon as I open a card to preview or edit in the new version 25.02.1, any `<iframe>` element is automatically removed (with no undo) with no warning, and harmless SVG attributes (such as `id` , `version`, `fill` on `<text>` elements but also HTML comments and other things) are stripped out.

**Expected behavior**

- I should be able to include `<iframe>` embeds (e.g. YouTube) in my card fields without them being stripped as soon as editing/previewing them. I know this removal already happens for JS script tags for security reasons, but this seems unjustified and breaks backward compatibility.
- SVG code and its attributes/HTML code comments should be preserved, as they were in Anki 24.11.

**Actual behavior (examples)**

- **Iframe stripped to empty:**
  - **Original field:**

```auto
<iframe width="849" height="478" src="https://www.youtube.com/embed/QZwneRb-zqA?start=731" title="Exploring How Computers Work" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>

```

- **After opening in 25.02.1:**  
_(no content – iframe completely removed)_
- **Another iframe completely removed:**
  - **Original:**

```auto
<iframe src="https://www.h-schmidt.net/FloatConverter/IEEE754.html" width="1100" height="430"></iframe>

```

- **Stripped:**  
_(removed entirely)_
- **Inline SVG attributes reordered/stripped and comments removed:**
  - **Original SVG block:**

```auto
<svg style="filter: drop-shadow(0px 0px 20px rgba(255,255,255,.4));" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="900" height="400" viewBox="0 0 1000 500" stroke="black" stroke-width="1" fill="black" font-family="DejaVu Sans,sans-serif" font-stretch="condensed" font-size="33px">
  <rect id="box" x="0" y="-40" width="50" height="50" fill="white"></rect>
  <!-- logo graphic -->
</svg>

```

- **After in 25.02.1:**

```auto
<svg font-size="33px" font-stretch="condensed" font-family="DejaVu Sans,sans-serif" fill="black" stroke-width="1" stroke="black" viewBox="0 0 1000 500" height="400" width="900" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" style="filter: drop-shadow(0px 0px 20px rgba(255,255,255,.4));">
  <rect fill="white" height="50" width="50" y="-40" x="0" id="box"></rect>
</svg>

```

I attached surther examples as screenshots below on WinMerge between the previous and current deck with partially stripped content from the cards I previewed before discovering the problem.

**What I’ve tried**

- Downgrading to 24.11 (restores previous behavior but isn’t viable long‑term).
- Reviewing the 25.02.1 release notes on GitHub ([Release 25.02.1 · ankitects/anki · GitHub](https://github.com/ankitects/anki/releases/tag/25.02.1)), which only mention stripping JavaScript handlers (iframes aren’t JS, so this feels unrelated).

**Questions / Help**

1. Was removing `<iframe>` tags and inline SVG attributes introduced intentionally in 25.02.1 for security reasons?
2. Is there a recommended way to keep embedding videos and preserving SVGs?
3. Could Anki offer a whitelist or a preference to allow trusted HTML tags like `<iframe>`?

My decks rely heavily on embedded, and I’d love to find a way to continue using these features in the latest Anki releases without losing my work.

 ![img_2025-04-18 230148](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/c/3cfced7346cbe946e421a31e54e23c7d6f54bf13.png)  
 ![img_2025-04-18 230446](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/2/8/2898a86a1ef418b97152b1ca8a3ab000e95cc9ee.png)  
 ![img_2025-04-18 230458](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/7/4/744192fe1f375c437a21bdf68a97a1d3bee3160f.png)  
 ![img_2025-04-18 232938](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/3X/3/8/38d6a6db5132e43e49aa9b825bf2413212e1dd39.png)

---

<div class="post-metadata">

**Author:** ![sam-med](https://avatars.discourse-cdn.com/v4/letter/s/a9adbd/32.png) [@sam-med](https://forums.ankiweb.net/u/sam-med)\
**Post date:** [April 18, 2025, 9:51pm UTC](https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290/2 "2025-04-18T21:51:14Z")

</div>

Opened an issue here: [Iframe and inline SVG attributes are stripped in Anki&nbsp;25.02.1 · Issue #3931 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/3931)

Related problem: [New field sanitation can break SVGs · Issue #3930 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/3930)

---

<div class="post-metadata">

**Author:** ![Anon\_0000](https://avatars.discourse-cdn.com/v4/letter/a/c67d28/32.png) [@Anon\_0000](https://forums.ankiweb.net/u/Anon_0000)\
**Post date:** [April 18, 2025, 9:51pm UTC](https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290/3 "2025-04-18T21:51:45Z")

</div>

Maybe that’s related to the dompurify package mentioned in [Custom HTML tags in Anki v⁨25.02.1](https://forums.ankiweb.net/t/custom-html-tags-in-anki-v-25-02-1/59246/3) by @abdo?

I don’t know if this package had only been intruduced after 24.11 though.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 18, 2025, 9:52pm UTC](https://forums.ankiweb.net/t/anki-25-02-1-removes-embedded-iframe-tags-and-svg-attributes/59290/4 "2025-05-18T21:52:25Z")

</div>

Closed on May 18, 2025, 9:52pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
