Affects Version/s: 2.4.6, 2.5, 2.5.2
When html content contains identical links, there is a problem on the enumerated links in the convert html to text.
Steps to reproduce :
1. Type this text in html format (a message forum by example).
2. Convert with html2test function (/lib/html2text.php).
This message has this bug, in the first line, the second link should be indexed 1 and not 0.
To reproduce these steps in Unit test (after the line 80 in https://github.com/moodle/moodle/blob/master/lib/tests/html2text_test.php).
One solution is to add these two lines (in _build_link_list function after the line 586 in https://github.com/moodle/moodle/blob/master/lib/html2text.php).