Merge pull request #465 from PokeAPI/ability-prose-inconsistency

Fix scrubbing for rare cases
This commit is contained in:
Alessandro Pezzè 2020-02-23 23:57:36 +01:00 committed by GitHub
commit 3ee375d490
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,7 +118,11 @@ def scrub_str(string):
if group[0]:
sub = group[0]
else:
sub = group[1].split(":")[1]
sub = group[1].split(":")
if len(sub) >= 2:
sub = sub[1]
else:
sub = sub[0]
sub = sub.replace("-", " ")
string = re.sub(SUB_RGX, sub, string, 1)
return string