Skip to content

Commit

Permalink
完善Markdown文件判断
Browse files Browse the repository at this point in the history
  • Loading branch information
Higurashi-kagome committed May 30, 2020
1 parent 116d3ad commit 5d80ed3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion AddTitleNumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion TOC.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 5d80ed3

Please sign in to comment.