While our new logic supported valid DOIs ended in punctuation and removed superfluous punctuation from otherwise valid DOIs, it didn't support both at the same time: a valid, old Wiley DOI ending in # couldn't be extracted if it also had trailing punctuation.
This fixes that by recursively stripping trailing punctuation one character at a time and re-extracting until a valid DOI is found.
While our new logic supported valid DOIs ended in punctuation and removed superfluous punctuation from otherwise valid DOIs, it didn't support both at the same time: a valid, old Wiley DOI ending in # couldn't be extracted if it also had trailing punctuation.
This fixes that by recursively stripping trailing punctuation one character at a time and re-extracting until a valid DOI is found.