# Check Media bug (\> symbol in alt attribute)

**URL:** <https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997>\
**Category:** Help\
**Created:** [January 4, 2023, 1:18am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997 "2023-01-04T01:18:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jcznk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jcznk/32/15215_2.png) [@jcznk](https://forums.ankiweb.net/u/jcznk)\
**Post date:** [January 4, 2023, 1:18am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997/1 "2023-01-04T01:18:58Z")

</div>

Steps to reproduce:

1. Add a new image to a note
2. Edit the HTML to add some attribute and write it **before** src  
The attribute must include the \> symbol: e.g. `alt="foo>"` or `title="<example>"`
3. Check Media → the image will be listed in the “unused media” section

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [January 4, 2023, 10:28am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997/2 "2023-01-04T10:28:23Z")

</div>

This happens because the filenames are extracted with a regex. It could be fixed with a more sophisticated parser, though I suspect it doesn’t affect many users.

---

<div class="post-metadata">

**Author:** ![jcznk](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/jcznk/32/15215_2.png) [@jcznk](https://forums.ankiweb.net/u/jcznk)\
**Post date:** [January 7, 2023, 1:43am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997/3 "2023-01-07T01:43:40Z")

</div>

Yeah, it should be quite a rare occurrence. It still might result in the occasional accidental loss of media, since images pasted e.g. from the web may have the \> symbol in their alt attribute (happened to me).

Would using a more sophisticated parser slow things down?

---

<div class="post-metadata">

**Author:** ![dae](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/dae/32/65_2.png) [@dae](https://forums.ankiweb.net/u/dae)\
**Post date:** [January 9, 2023, 1:45am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997/4 "2023-01-09T01:45:40Z")

</div>

I’ve logged this on [Deal with `\>` in alt tags · Issue #2304 · ankitects/anki · GitHub](https://github.com/ankitects/anki/issues/2304)

---

<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:** [February 8, 2023, 1:45am UTC](https://forums.ankiweb.net/t/check-media-bug-symbol-in-alt-attribute/25997/5 "2023-02-08T01:45:46Z")

</div>

Closed on February 8, 2023, 1:45am UTC

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