'Get the title of enumerable nodes to refer them using its title'

def get_numfig_title(self, node):

    if self.is_enumerable_node(node):
        (_, title_getter) = self.enumerable_nodes.get(node.__class__, (None, None))
        if title_getter:
            return title_getter(node)
        else:
            for subnode in node:
                if (subnode.tagname in ('caption', 'title')):
                    return clean_astext(subnode)
    return None
