reStructuredText: fix autonumber footnote references
LinkResolver: fix rewriting of link targets