We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[Bug] Broken links in MASTG Webpage
### MASTG Chapter

0x04g-Testing-Cryptography.md

### File Line Number

90

### Context

The links to "Data Storage on Android"  and "Data Storage on iOS" lead to 404

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `tools/scripts/transform_files.py`
Content:
```
1 import re, os
2 from pathlib import Path
3 
4 EMOJIS_regex = r"🥇 |🎁 |📝 |❗ "
5 
6 def transform_links(file_text):
7     print("[*] Regex Substitutions ../Document to MASTG/")
8     found = re.findall(r'(\((?:../)*Document/.*\.md/*)', file_text)
9     print(f"    Found: {found}")
10     return re.sub(r"\(((?:../)*)Document/(.*)\.md/*", r"(\1MASTG/\2/", file_text)
11 
12 def remove_emojis(file_text):
13     print("[*] Regex Substitutions for emojis")
14     found = re.findall(EMOJIS_regex, file_text)
15     print(f"    Found: {found}")
16     return re.sub(EMOJIS_regex, r"", file_text)
17 
18 def transform(folder, functions):
19     print(f"[*] Applying transforms to {folder}")
20     for root, dirname, filenames in os.walk(folder):
21         if len(filenames):
22             files = Path(root).glob('*.md')
23 
24             for file in files:
25                 file_obj = Path(file)
26                 print(f"    - File {file_obj.as_posix()}")
27                 file_text = file_obj.read_text()
28                 
29                 new_text = None
30                 for function in functions:
31                     if new_text is None:
32                         new_text = function(file_text)
33                     else:
34                         new_text = function(new_text)
35 
36                 file_obj.write_text(new_text)
37 
38 transform("docs", [transform_links])
39 transform("Document", [remove_emojis])
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/tools/scripts/transform_files.py b/tools/scripts/transform_files.py
--- a/tools/scripts/transform_files.py
+++ b/tools/scripts/transform_files.py
@@ -4,10 +4,22 @@
 EMOJIS_regex = r"🥇 |🎁 |📝 |❗ "
 
 def transform_links(file_text):
-    print("[*] Regex Substitutions ../Document to MASTG/")
-    found = re.findall(r'(\((?:../)*Document/.*\.md/*)', file_text)
-    print(f"    Found: {found}")
-    return re.sub(r"\(((?:../)*)Document/(.*)\.md/*", r"(\1MASTG/\2/", file_text)
+    # print("[*] Regex Substitutions ../Document to MASTG/")
+    found = re.findall(r'(\(0x.*\.md/*)', file_text)
+
+    # TODO FIX we must find a better solution to this
+    while len(found) > 0:
+        print(f"    Found: {found}")
+        file_text = re.sub(r"\((0x0[1-3].*\.md)", r"(../Intro/\1", file_text)
+        file_text = re.sub(r"\((0x04.*\.md)", r"(../General/\1", file_text)
+        file_text = re.sub(r"\((0x05.*\.md)", r"(../Android/\1", file_text)
+        file_text = re.sub(r"\((0x06.*\.md)", r"(../iOS/\1", file_text)
+        file_text = re.sub(r"\((0x08.*\.md)", r"(../Tools/\1", file_text)
+        file_text = re.sub(r"\((0x09.*\.md)", r"(../References/\1", file_text)
+
+        found = re.findall(r'(\(0x.*\.md/*)', file_text)
+
+    return file_text
 
 def remove_emojis(file_text):
     print("[*] Regex Substitutions for emojis")
@@ -35,5 +47,5 @@
 
                 file_obj.write_text(new_text)
 
-transform("docs", [transform_links])
-transform("Document", [remove_emojis])
\ No newline at end of file
+transform("docs/MASTG", [transform_links])
+# transform("docs/MASTG", [remove_emojis])
\ No newline at end of file

{"golden_diff": "diff --git a/tools/scripts/transform_files.py b/tools/scripts/transform_files.py\n--- a/tools/scripts/transform_files.py\n+++ b/tools/scripts/transform_files.py\n@@ -4,10 +4,22 @@\n EMOJIS_regex = r\"\ud83e\udd47 |\ud83c\udf81 |\ud83d\udcdd |\u2757 \"\n \n def transform_links(file_text):\n-    print(\"[*] Regex Substitutions ../Document to MASTG/\")\n-    found = re.findall(r'(\\((?:../)*Document/.*\\.md/*)', file_text)\n-    print(f\"    Found: {found}\")\n-    return re.sub(r\"\\(((?:../)*)Document/(.*)\\.md/*\", r\"(\\1MASTG/\\2/\", file_text)\n+    # print(\"[*] Regex Substitutions ../Document to MASTG/\")\n+    found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n+\n+    # TODO FIX we must find a better solution to this\n+    while len(found) > 0:\n+        print(f\"    Found: {found}\")\n+        file_text = re.sub(r\"\\((0x0[1-3].*\\.md)\", r\"(../Intro/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x04.*\\.md)\", r\"(../General/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x05.*\\.md)\", r\"(../Android/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x06.*\\.md)\", r\"(../iOS/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x08.*\\.md)\", r\"(../Tools/\\1\", file_text)\n+        file_text = re.sub(r\"\\((0x09.*\\.md)\", r\"(../References/\\1\", file_text)\n+\n+        found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n+\n+    return file_text\n \n def remove_emojis(file_text):\n     print(\"[*] Regex Substitutions for emojis\")\n@@ -35,5 +47,5 @@\n \n                 file_obj.write_text(new_text)\n \n-transform(\"docs\", [transform_links])\n-transform(\"Document\", [remove_emojis])\n\\ No newline at end of file\n+transform(\"docs/MASTG\", [transform_links])\n+# transform(\"docs/MASTG\", [remove_emojis])\n\\ No newline at end of file\n", "issue": "[Bug] Broken links in MASTG Webpage\n### MASTG Chapter\n\n0x04g-Testing-Cryptography.md\n\n### File Line Number\n\n90\n\n### Context\n\nThe links to \"Data Storage on Android\"  and \"Data Storage on iOS\" lead to 404\n", "before_files": [{"content": "import re, os\nfrom pathlib import Path\n\nEMOJIS_regex = r\"\ud83e\udd47 |\ud83c\udf81 |\ud83d\udcdd |\u2757 \"\n\ndef transform_links(file_text):\n    print(\"[*] Regex Substitutions ../Document to MASTG/\")\n    found = re.findall(r'(\\((?:../)*Document/.*\\.md/*)', file_text)\n    print(f\"    Found: {found}\")\n    return re.sub(r\"\\(((?:../)*)Document/(.*)\\.md/*\", r\"(\\1MASTG/\\2/\", file_text)\n\ndef remove_emojis(file_text):\n    print(\"[*] Regex Substitutions for emojis\")\n    found = re.findall(EMOJIS_regex, file_text)\n    print(f\"    Found: {found}\")\n    return re.sub(EMOJIS_regex, r\"\", file_text)\n\ndef transform(folder, functions):\n    print(f\"[*] Applying transforms to {folder}\")\n    for root, dirname, filenames in os.walk(folder):\n        if len(filenames):\n            files = Path(root).glob('*.md')\n\n            for file in files:\n                file_obj = Path(file)\n                print(f\"    - File {file_obj.as_posix()}\")\n                file_text = file_obj.read_text()\n                \n                new_text = None\n                for function in functions:\n                    if new_text is None:\n                        new_text = function(file_text)\n                    else:\n                        new_text = function(new_text)\n\n                file_obj.write_text(new_text)\n\ntransform(\"docs\", [transform_links])\ntransform(\"Document\", [remove_emojis])", "path": "tools/scripts/transform_files.py"}], "after_files": [{"content": "import re, os\nfrom pathlib import Path\n\nEMOJIS_regex = r\"\ud83e\udd47 |\ud83c\udf81 |\ud83d\udcdd |\u2757 \"\n\ndef transform_links(file_text):\n    # print(\"[*] Regex Substitutions ../Document to MASTG/\")\n    found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n\n    # TODO FIX we must find a better solution to this\n    while len(found) > 0:\n        print(f\"    Found: {found}\")\n        file_text = re.sub(r\"\\((0x0[1-3].*\\.md)\", r\"(../Intro/\\1\", file_text)\n        file_text = re.sub(r\"\\((0x04.*\\.md)\", r\"(../General/\\1\", file_text)\n        file_text = re.sub(r\"\\((0x05.*\\.md)\", r\"(../Android/\\1\", file_text)\n        file_text = re.sub(r\"\\((0x06.*\\.md)\", r\"(../iOS/\\1\", file_text)\n        file_text = re.sub(r\"\\((0x08.*\\.md)\", r\"(../Tools/\\1\", file_text)\n        file_text = re.sub(r\"\\((0x09.*\\.md)\", r\"(../References/\\1\", file_text)\n\n        found = re.findall(r'(\\(0x.*\\.md/*)', file_text)\n\n    return file_text\n\ndef remove_emojis(file_text):\n    print(\"[*] Regex Substitutions for emojis\")\n    found = re.findall(EMOJIS_regex, file_text)\n    print(f\"    Found: {found}\")\n    return re.sub(EMOJIS_regex, r\"\", file_text)\n\ndef transform(folder, functions):\n    print(f\"[*] Applying transforms to {folder}\")\n    for root, dirname, filenames in os.walk(folder):\n        if len(filenames):\n            files = Path(root).glob('*.md')\n\n            for file in files:\n                file_obj = Path(file)\n                print(f\"    - File {file_obj.as_posix()}\")\n                file_text = file_obj.read_text()\n                \n                new_text = None\n                for function in functions:\n                    if new_text is None:\n                        new_text = function(file_text)\n                    else:\n                        new_text = function(new_text)\n\n                file_obj.write_text(new_text)\n\ntransform(\"docs/MASTG\", [transform_links])\n# transform(\"docs/MASTG\", [remove_emojis])", "path": "tools/scripts/transform_files.py"}]}