'Generate hyperlink targets for listings.
Original visit_bullet_list(), visit_definition_list() and visit_enumerated_list()
generates hyperlink targets inside listing tags (<ul>, <ol> and <dl>) if multiple
IDs are assigned to listings.  That is invalid DOM structure.
(This is a bug of docutils <= 0.12)
This exports hyperlink targets before listings to make valid DOM structure.'

def generate_targets_for_listing(self, node):

    for id in node['ids'][1:]:
        self.body.append(('<span    id="%s"></span>' % id))
        node['ids'].remove(id)
