diff --git a/BlogUpdate.py b/BlogUpdate.py index 6518242..9341b23 100644 --- a/BlogUpdate.py +++ b/BlogUpdate.py @@ -7,33 +7,24 @@ docx_folder = "./docx_files" # Folder to hold the .docx files def extract_text_from_docx(file_path): - """Extract text from .docx file and preserve basic formatting, including ordered and unordered lists.""" + """Extract text from .docx file and preserve basic formatting, including lists.""" doc = docx.Document(file_path) full_text = [] - inside_ul = False - inside_ol = False + inside_list = False for para in doc.paragraphs: - # Check for bullet points (unordered list) - if para.style.name.startswith('List Bullet'): - if not inside_ul: - full_text.append("") - if inside_ol: - full_text.append("") return "\n".join(full_text)