Эх сурвалжийг харах

fix stupid apostrophe character

Kirk Trombley 2 жил өмнө
parent
commit
aa0afa1a07

+ 5 - 5
data/pokedex.json

@@ -1597,10 +1597,10 @@
   },
   "83": {
     "num": 83,
-    "species": "Farfetch\u2019d",
+    "species": "Farfetch'd",
     "forms": [
       {
-        "name": "Farfetch\u2019d",
+        "name": "Farfetch'd",
         "traits": [],
         "types": [
           "Normal",
@@ -1609,7 +1609,7 @@
         "color": "Brown"
       },
       {
-        "name": "Farfetch\u2019d-Galar",
+        "name": "Farfetch'd-Galar",
         "traits": [
           "galar",
           "regional"
@@ -15470,10 +15470,10 @@
   },
   "865": {
     "num": 865,
-    "species": "Sirfetch\u2019d",
+    "species": "Sirfetch'd",
     "forms": [
       {
-        "name": "Sirfetch\u2019d",
+        "name": "Sirfetch'd",
         "traits": [],
         "types": [
           "Fighting"

+ 2 - 2
tools/download.py

@@ -59,8 +59,8 @@ async def load_pokedex() -> dict:
   cleaned = text.replace("exports.BattlePokedex = ", "").strip(";")
   # then convert the keys to strings
   converted = re.sub(JS_TO_JSON, lambda m: f'"{m.group(1)}":', cleaned)
-  # and fix Type: Null
-  fixed = converted.replace('""Type": Null"', '"Type: Null"')
+  # and fix Type: Null, Farfetch'd, Sirfetch'd
+  fixed = converted.replace('""Type": Null"', '"Type: Null"').replace("’", "'")
   # then, parse it
   return json.loads(fixed)