Skip to content

Commit ea1e7c0

Browse files
JanardhanamJanardhanam
authored andcommitted
fixed bug where txt file didn't get text processing changes
1 parent 6bed6f9 commit ea1e7c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

HTML-Beauti.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,12 @@ def main():
102102

103103
print(".", end=" ")
104104

105+
filetxt = os.path.join(folderpath, KBID)+'.txt'
106+
105107
#exports file with as HTML and TXT
106108
with open(filepath, 'w', encoding="utf-8") as file:
107109
file.write(str(soup))
108-
with open(os.path.join(folderpath, KBID)+'.txt', 'w', encoding="utf-8") as file:
110+
with open(filetxt, 'w', encoding="utf-8") as file:
109111
file.write(str(soup))
110112

111113
print(".", end=" ")
@@ -115,6 +117,11 @@ def main():
115117
file_replace_text(filepath, '</body>', '</div>\n</body>')
116118
file_replace_text(filepath, '', '=>')
117119

120+
file_replace_text(filetxt, '<p><br/></p>', '')
121+
file_replace_text(filetxt, '<body>', '<body>\n<div>')
122+
file_replace_text(filetxt, '</body>', '</div>\n</body>')
123+
file_replace_text(filetxt, '', '=>')
124+
118125
print('done!', end=" ")
119126
sys.stdout.flush()
120127

0 commit comments

Comments
 (0)