def substitute_numbered_entity(node): try: value = int(node.leaf()) # We eliminate some characters such as < and > if value in [60, 62]: raise Exception() node.value = py3compat.unichr(value) except: node.value = '&#%s;' % value
def render_entity(node): value = '%s' % node.leaf() if value in html_entities: node.value = '%s' % py3compat.unichr(html_entities[value]) else: node.value = '&%s;' % value
def substitute_named_entity(node): value = '%s' % node.leaf() if value in html_entities and value not in ['lt', 'gt']: node.value = py3compat.unichr(html_entities[value]) else: node.value = '&%s;' % value
def render_entity(node): value = '%s' % node.leaf() if value in html_entities: node.value = '%s' % py3compat.unichr(html_entities[value]) else: node.value = '&%s;' % value