(file_path: str)
| 385 | |
| 386 | |
| 387 | def parse_html(file_path: str) -> List[dict]: |
| 388 | from bs4 import BeautifulSoup |
| 389 | |
| 390 | with open(file_path, 'r', encoding='utf-8') as f: |
| 391 | soup = BeautifulSoup(f, 'lxml') |
| 392 | |
| 393 | content = [{'text': clean_text(p.get_text())} |
| 394 | for p in soup.find_all(['p', 'div']) if p.get_text().strip()] |
| 395 | |
| 396 | return [{ |
| 397 | 'page_num': 1, |
| 398 | 'content': content, |
| 399 | 'title': soup.title.string if soup.title else '' |
| 400 | }] |
| 401 | |
| 402 | |
| 403 | def extract_xml_skeleton_markdown(xml_file): |
nothing calls this directly
no test coverage detected