Closed shigeyukey closed 3 months ago
Highlighting doesn't work due to HTML, but it doesn't cause errors, so I think it would be better to upload it anyway and fix it later.
If there is a lot of HTML like this in a medical decks, etc., then fixing it would be a high priority. I have not looked into this yet.
This issue was solved with advice from glutanimate. (AnkiForums)
glutanimate : Qt’s find text works on rendered text, so you will have to strip any markup from the query.
I took the advice and made a simple fix.
# browser.py
from bs4 import BeautifulSoup # <- add
# browser.py
for field in note.fields:
# cloze_deletions = re.findall(r"(\{\{c(\d+)::(.+?)(::(.*?))?\}\})", field, re.DOTALL)
field = BeautifulSoup(field, "html.parser").get_text() # <- add
cloze_deletions = re.findall(r"(\{\{c(\d+)::(.+?)(::(.*?))?\}\})", field, re.DOTALL)
https://forums.ankiweb.net/t/suggestion-highlight-cloze-in-card-when-selected-in-browser/45726