check letter % after removing spaces or tabs in the left

This commit is contained in:
OverKit 2023-06-12 10:09:52 +08:00 committed by GitHub
parent 9fd212652e
commit 9ac3d0d65d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -127,7 +127,7 @@ def rm_comments(main_file):
new_file_remove_comment_lines = []
for l in main_file.splitlines():
# 删除整行的空注释
if l.startswith("%") or (l.startswith(" ") and l.lstrip().startswith("%")):
if l.lstrip().startswith("%"):
pass
else:
new_file_remove_comment_lines.append(l)