HTMLSerializer.serialize has a chained if/else that ends with this:
else:
self.serializeError(token["data"])
I propose supporting a custom fallback method that would allow subclasses to invoke the benefit of this serializer's method to deal with unknown/custom token types. this would allow custom parsers/tree-adapters the ability to override how something is rendered by changing the token type and registering a custom handler... which still leveraging the core serializer.
for example:
else:
if self._customTypes and (type in self._customTypes):
yield self.self._customTypes[type](token)
else:
self.serializeError(token["data"])
The text was updated successfully, but these errors were encountered:
HTMLSerializer.serializehas a chained if/else that ends with this:I propose supporting a custom fallback method that would allow subclasses to invoke the benefit of this serializer's method to deal with unknown/custom token types. this would allow custom parsers/tree-adapters the ability to override how something is rendered by changing the token type and registering a custom handler... which still leveraging the core serializer.
for example:
The text was updated successfully, but these errors were encountered: