kerrickstaley / genanki

A Python 3 library for generating Anki decks
MIT License
2.06k stars 161 forks source link

Field contained the following invalid HTML tags in GUID #121

Closed PanderMusubi closed 10 months ago

PanderMusubi commented 1 year ago

Description Field contained the following invalid HTML tags.

To reproduce Use guid containing <p8 e.g..

Expected behavior HTML tags should not be checked for guid perhaps?

Actual behavior Warming gets printed:

~/.local/lib/python3.10/site-packages/genanki/note.py:153: UserWarning: Field contained the following invalid HTML tags. Make sure you are calling html.escape() if your field data isn't already HTML-encoded: <p8{N2>
  warnings.warn("Field contained the following invalid HTML tags. Make sure you are calling html.escape() if"

genanki version 0.13.0

Additional context Using pprint(self.fields[-1]) helps for debugging. These are valid values

'mG!uQ0:Vaa'
'phJgSa.0<A'
'q-j%yoC$6t'
'jME[c!LmuS'
'uK6|=e8*BU'
're?KG.[pR-'
'F=6:v}NdTB'
'd(nZ^NdjTO'
'BAlO]`HJQg'
'f.2v`3WgFR'
'Dy(+X(BhdM'
'm82/uZ.;[u'

This is an invalid value

'Gt<p8{N2>Z'
PanderMusubi commented 1 year ago

PS This occurred when using https://github.com/lukesmurray/markdown-anki-decks

kerrickstaley commented 11 months ago

I was unable to reproduce this issue. Could you give a complete, minimal example that I can run to see the issue?

I added this test which I thought would reproduce the problem, but the test already passes without changing genanki's code.

kerrickstaley commented 10 months ago

Closing this issue for now; please re-open this if you are still seeing this problem!