Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Anki integration: Definitions with images do not work #1741

Closed
shoui520 opened this issue Jun 16, 2021 · 4 comments · Fixed by #1805
Closed

Anki integration: Definitions with images do not work #1741

shoui520 opened this issue Jun 16, 2021 · 4 comments · Fixed by #1805

Comments

@shoui520
Copy link

For an upcoming monolingual dictionary we are making we are taking advantage of Yomichan's images and gaiji (structured-content) feature.
They display correctly in the extension but not without this CSS

chrome_UKY0amtaF0
chrome_0nKeQ2XrDx

Well done.

However, when you try to make an Anki card from it, the glossary field turns into [object Object]
Here are my Anki integration settings
brave_yyR2Gf65hp
I mainly use the handlebars.js featured on animecards.site, which adds the {test} field, which adds definitions to your cards in plain text.
However, this does not matter here as stock handlebars.js and either {glossary} or {glossary-brief} have the exact same result

chrome_nWXh5n4ecI

The Anki card result...
anki_cX5kkBoLDC

@shoui520 shoui520 changed the title Anki integration: Definitions with images break Anki integration: Definitions with images do not work Jun 16, 2021
@shoui520
Copy link
Author

I have attached a test dictionary that includes the entries 藍, 亜 and 謎
test-dictionary.zip

@toasted-nutbread
Copy link
Collaborator

toasted-nutbread commented Jun 16, 2021

Yes, this is currently expected. Anki integration isn't implemented yet for either images or structured-content, and the "definition" text is a JSON object instead of a string, so handlebars stringifies it to "[Object object]". I'll have to make some changes to how Anki receives the images and formats the fields.

@shoui520
Copy link
Author

@toasted-nutbread I have a question regarding this.
Will fixing this require making additional changes to the dictionary? Or will that handled entirely by the add-on?

@toasted-nutbread
Copy link
Collaborator

No changes required.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants