def METHOD_NAME(node, f):
    if node.tag in ["tex-math", "url"]:
        return
    if node.text is not None:
        node.text = f(node.text)
    for child in node:
        METHOD_NAME(child, f)
        if child.tail is not None:
            child.tail = f(child.tail)