anki-plugins icon indicating copy to clipboard operation
anki-plugins copied to clipboard

Not Showing the type errors

Open vijaykrishnaabba7 opened this issue 2 years ago • 1 comments

Everything is working fine here

1 Take a look at this.

3_Trim

With normal text errors and the correct answer is displayed, However, when using the syntax highlighter addon on text, incorrect text is not displayed. syntax highlighter addon: https://ankiweb.net/shared/info/1463041493

Thank you for your excellent add-on These past few months I have been looking for this kind of add-on, Google, on the other hand, always shows the Multi-Line Type Answer Box add-on which only works on basic cards. I preferred to search with multiple lines rather than multiple types, but I finally found it. Thank you so much.

vijaykrishnaabba7 avatar Feb 04 '22 12:02 vijaykrishnaabba7

@ssricardo, I found this issue because the add-on doesn't work properly any time the answer contains HTML as in vijaykrishnaabba7's non-working example above, including character codes like  , >, <, &, etc.

I quickly scanned your code and noticed the original_clear_correct_value function in handler.py should strip HTML on line 238 (cor = stripHTML(cor)), so perhaps stripHTML is not working properly or as you had expected. Or maybe there's an unnecessary double-conversion somewhere. Another case to consider: is Anki processing the typed answer in a way your code doesn't expect?

I would offer to help, but I don't have experience with Anki add-on development or Python yet. That may change in the future, at which time I would create some unit tests to catch issues like this. In the meantime, I very much appreciate your efforts with this add-on. It is essential to my recall practice, as well.

lightmotive avatar Sep 26 '22 18:09 lightmotive