Closed ChuckieChen945 closed 1 week ago
Escape the brackets and it should work.
Thank you for your suggestion. I’ve tried the following code:
{{front}}</br>
<img src="_heart[123].png">
<img src="_heart[_test.png">
<img src="_heart.png">
and also:
{{front}}</br>
<img src="_heart\[123\].png">
<img src="_heart\[_test.png">
<img src="_heart.png">
However, escaping the brackets using [
and ]
or \
did not resolve the issue. Neither the manual nor the FAQ provides a solution for this specific problem. Did I miss something? If so, could you please clarify further?
It’s worth noting that using square brackets ([ ]
) in filenames works perfectly fine in Anki Desktop without any need for escaping. This inconsistency between AnkiDroid and Anki Desktop appears to be an Anki Ecosystem Compatibility issue.
I believe it would be ideal to align AnkiDroid's behavior with Anki Desktop to ensure a consistent user experience across platforms. Thank you for considering this, and please let me know if you need any additional information or testing!
@ChuckieChen945 I just tested this out of curiosity and it works. Did you try closing those img tags:
<img src="_heart[123].png" />
?
After further investigation, I discovered that media files containing square brackets cannot be synced via AnkiWeb. It appears that Anki does not support special characters, including square brackets, in media filenames.
When you add media to a field—either by using the paperclip icon in the editor or by pasting it into a field—Anki automatically handles special characters. However, referencing media files with special characters directly in templates may lead to issues.
Thank you again for your time and support in addressing this matter! I’m leaving this information here as a reference for others who may encounter similar problems.
Checked for duplicates?
Does it also happen in the desktop version?
What are the steps to reproduce this bug?
Reference some media files in the card template, with some filenames containing square brackets (not necessarily in pairs), as shown below:
Expected behaviour
Media files with filenames containing square brackets should be handled correctly, as they are in Anki Desktop:
Debug info
(Optional) Anything else you want to share?
No response
Research