Check Media bug (> symbol in alt attribute)

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
1 Like

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.

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?

I’ve logged this on Deal with `>` in alt tags · Issue #2304 · ankitects/anki · GitHub


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