FooSoft / yomichan-anki

Plugin for sentence/vocab mining Japanese books in Anki.
https://foosoft.net/projects/yomichan-anki
Other
58 stars 12 forks source link

"Add term"-icons don't appear when Expression-field is set to %s #3

Closed Leitsi closed 9 years ago

Leitsi commented 11 years ago

As topic says, I'm unable to add any facts when Expression-field is set to %s. The icons on definitions simply don't appear.

I was able to narrow it down a bit, though I'm not sure if this is the source of the problem or a safe way to fix it. In reader_util.py file, buildDefinitionHtml-function: adding definition.sentence as last parameter to buildFactMarkupExpression and buildFactMarkupReading -function calls seems to do the trick:

if factQuery:
        if factQuery(buildFactMarkupExpression(definition.expression, definition.reading, definition.glossary, definition.sentence)):
            links += '<a href = "addExpression:{0}"><img src = "://img/img/icon_add_expression.png" align = "right"/></a>'.format(factIndex)
        if factQuery(buildFactMarkupReading(definition.reading, definition.glossary, definition.sentence)):
            links += '<a href = "addReading:{0}"><img src = "://img/img/icon_add_reading.png" align = "right"/></a>'.format(factIndex)
FooSoft commented 9 years ago

This is really old and I can't seem to reproduce it. It probably was fixed in one of the big Yomichan overhauls. If it's still a problem, reopen this.