Skip to content

Commit 16b229c

Browse files
committed
修复 issue egrcc#41 中的 bug
1 parent 13b07d3 commit 16b229c

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

zhihu.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -819,6 +819,7 @@ def to_txt(self):
819819
# print file_name
820820
# else:
821821
# print file_name
822+
file_name = file_name.replace("/", "'SLASH'")
822823
if os.path.exists(os.path.join(os.path.join(os.getcwd(), "text"), file_name)):
823824
f = open(os.path.join(os.path.join(os.getcwd(), "text"), file_name), "a")
824825
f.write("\n\n")
@@ -839,6 +840,7 @@ def to_txt(self):
839840
# print file_name
840841
# else:
841842
# print file_name
843+
file_name = file_name.replace("/", "'SLASH'")
842844
f = open(os.path.join(os.path.join(os.getcwd(), "text"), file_name), "wt")
843845
f.write(self.get_question().get_title() + "\n\n")
844846
if platform.system() == 'Windows':
@@ -884,6 +886,7 @@ def to_md(self):
884886
# print file_name
885887
# else:
886888
# print file_name
889+
file_name = file_name.replace("/", "'SLASH'")
887890
if not os.path.isdir(os.path.join(os.path.join(os.getcwd(), "markdown"))):
888891
os.makedirs(os.path.join(os.path.join(os.getcwd(), "markdown")))
889892
if os.path.exists(os.path.join(os.path.join(os.getcwd(), "markdown"), file_name)):
@@ -907,6 +910,7 @@ def to_md(self):
907910
# print file_name
908911
# else:
909912
# print file_name
913+
file_name = file_name.replace("/", "'SLASH'")
910914
f = open(os.path.join(os.path.join(os.getcwd(), "markdown"), file_name), "wt")
911915
f.write("# " + self.get_question().get_title() + "\n")
912916
if platform.system() == 'Windows':

0 commit comments

Comments
 (0)