Looks like we'll need to decode entities prior to the striptags pass in generating the plaintext file descriptions.
Report (https://github.com/wikimedia/wikipedia-ios/pull/2310#issuecomment-391008942):
@mdholloway I ran across this description while testing:
<a href=\"<a rel=\"nofollow\" class=\"external free\" href=\"http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998\">http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998</a>\" rel=\"nofollow\">Queensland State Archives Digital Image ID 7998</a>via https://en.wikipedia.org/api/rest_v1/page/media/Diana,_Princess_of_Wales
Then I tried:
> striptags("<a href=\"<a rel=\"nofollow\" class=\"external free\" href=\"http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998\">http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998</a>\" rel=\"nofollow\">Queensland State Archives Digital Image ID 7998</a>")and got
<a href="http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998" rel="nofollow">Queensland State Archives Digital Image ID 7998</a>I don't think we can do much about them explicitly encoding HTML tags into the plaintext description using entities (multiple passes of striptags?), but might make sense to at least expand the HTML entities to get <a href="http://www.archivessearch.qld.gov.au/Image/DigitalImageDetails.aspx?ImageId=7998" rel="nofollow">Queensland State Archives Digital Image ID 7998</a>