html formatter does not support deep custom tokens
The function _get_ttype_class() in html.py is designed to create css class names for custom token types (of the form standardclass-subtype1-subtype2 etc.). But it does do this for a single custom subtype only, due to the statement
fname = STANDARD_TYPES.get(ttype)
inside the loop
while fname is None:
After executing the offending statement once, fname won’t be None any longer due to the default empty string parameter in get(). Removing the default value fixes the problem - and won’t loop forever because Token itself is in STANDARD_TYPES.
Reported by guest