This commit is contained in:
unknown
2025-12-23 19:26:28 -08:00
parent b05d1dfc88
commit c3bd1f6d1e

View File

@@ -511,14 +511,7 @@ def convert2epub(id:str)-> bool:
error = f'Unsupported file format: {file_ext}'
print(error)
return False
if file_ext == '.txt':
with open(file_input, 'r', encoding='utf-8') as f:
text = f.read()
text = text.replace('\r\n', '\n')
text = text.replace('\n\n', '\n[pause]\n')
with open(file_input, 'w', encoding='utf-8') as f:
f.write(text)
elif file_ext == '.pdf':
if file_ext == '.pdf':
msg = 'File input is a PDF. flatten it in XHTML...'
print(msg)
doc = fitz.open(file_input)