diff --git a/AddTitleNumber.py b/AddTitleNumber.py index 2c67a12..476d20b 100644 --- a/AddTitleNumber.py +++ b/AddTitleNumber.py @@ -114,7 +114,7 @@ def create_markdown_file_with_number(f): file_and_dir = os.listdir(path) print('当前目录下的Markdown文件:') for item in file_and_dir: - if item.split('.')[-1] in ['md','Md','MD','Markdown','markdown'] and os.path.isfile(item): + if item.split('.')[-1].lower() in ['md','mdown','markdown'] and os.path.isfile(item): print(item) file_name = input('请输入文件名(含后缀)\n') else: diff --git a/TOC.py b/TOC.py index 0645211..b7319ee 100644 --- a/TOC.py +++ b/TOC.py @@ -64,7 +64,7 @@ def creat_file_with_toc(f): file_and_dir = os.listdir(path) print('当前目录下的Markdown文件:') for item in file_and_dir: - if item.split('.')[-1] in ['md','Md','MD','Markdown','markdown'] and os.path.isfile(item): + if item.split('.')[-1].lower() in ['md','mdown','markdown'] and os.path.isfile(item): print(item) file_name = input('请输入文件名(含后缀)\n') else: