Custom html serializer for span and blocks