File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11"""Markdown file parsing utilities for link extraction and replacement."""
22
3- from pathlib import Path
43import re
4+ from pathlib import Path
55
66
77def get_files (directory ):
@@ -22,7 +22,7 @@ def get_md_links(md_file_path: list):
2222
2323 for file in md_file_path :
2424 try :
25- with open (file , "r" , encoding = "utf-8" ) as md :
25+ with open (file , encoding = "utf-8" ) as md :
2626 content = md .read ()
2727 matches = re .findall (pattern , content )
2828 for text , url in matches :
@@ -37,7 +37,7 @@ def get_md_links(md_file_path: list):
3737def replace_link (md_file_path , bad_links ):
3838 """Replace bad links with their text content in markdown files."""
3939 try :
40- with open (md_file_path , "r" , encoding = "utf-8" ) as f :
40+ with open (md_file_path , encoding = "utf-8" ) as f :
4141 content = f .read ()
4242
4343 # Apply all replacements
@@ -54,4 +54,5 @@ def replace_link(md_file_path, bad_links):
5454
5555 except Exception as e :
5656 print (f"Error updating { md_file_path } : { e } " )
57- return False
57+ return False
58+
You can’t perform that action at this time.
0 commit comments