Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix finding media to inject in anki note generator #1848

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kuuuube
Copy link
Member

@Kuuuube Kuuuube commented Feb 27, 2025

The previous function was ridiculous and ended up failing on some weird combinations of nested objects and arrays. Which Yomitan dicts tend to be extremely prone to creating.

Since all that is required is extracting a string for the path to media, it is much easier to flatten the entire definition structure into a string and search it with regex. No witchcraft necessary.

The media in this case only includes images or svgs contained in definitions. Audio fetching has no issue.

@Kuuuube Kuuuube added kind/bug The issue or PR is regarding a bug area/anki The issue or PR is related to Anki integration labels Feb 27, 2025
@Kuuuube Kuuuube requested a review from a team as a code owner February 27, 2025 01:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/anki The issue or PR is related to Anki integration kind/bug The issue or PR is regarding a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant