|
49 | 49 | DocItemLabel.DOCUMENT_INDEX, |
50 | 50 | DocItemLabel.SECTION_HEADER, |
51 | 51 | DocItemLabel.PARAGRAPH, |
52 | | - DocItemLabel.CAPTION, |
53 | 52 | DocItemLabel.TABLE, |
54 | 53 | DocItemLabel.PICTURE, |
55 | 54 | DocItemLabel.FORMULA, |
|
58 | 57 | DocItemLabel.TEXT, |
59 | 58 | DocItemLabel.LIST_ITEM, |
60 | 59 | DocItemLabel.CODE, |
| 60 | + DocItemLabel.REFERENCE, |
61 | 61 | } |
62 | 62 |
|
63 | 63 |
|
@@ -2055,10 +2055,6 @@ def export_to_markdown( # noqa: C901 |
2055 | 2055 | text = f"```\n{item.text}\n```\n" |
2056 | 2056 | mdtexts.append(text) |
2057 | 2057 |
|
2058 | | - elif isinstance(item, TextItem) and item.label in [DocItemLabel.CAPTION]: |
2059 | | - # captions are printed in picture and table ... skipping for now |
2060 | | - continue |
2061 | | - |
2062 | 2058 | elif isinstance(item, ListItem) and item.label in [DocItemLabel.LIST_ITEM]: |
2063 | 2059 | in_list = True |
2064 | 2060 | # Calculate indent based on list_nesting_level |
@@ -2350,10 +2346,6 @@ def close_lists( |
2350 | 2346 | text = f"<pre>{item.text}</pre>" |
2351 | 2347 | html_texts.append(text) |
2352 | 2348 |
|
2353 | | - elif isinstance(item, TextItem) and item.label in [DocItemLabel.CAPTION]: |
2354 | | - # captions are printed in picture and table ... skipping for now |
2355 | | - continue |
2356 | | - |
2357 | 2349 | elif isinstance(item, ListItem): |
2358 | 2350 |
|
2359 | 2351 | text = f"<li>{item.text}</li>" |
@@ -2555,10 +2547,6 @@ def close_lists( |
2555 | 2547 | result += f"<unordered_list>{delim}" |
2556 | 2548 | in_ordered_list.append(False) |
2557 | 2549 |
|
2558 | | - elif isinstance(item, TextItem) and item.label in [DocItemLabel.CAPTION]: |
2559 | | - # captions are printed in picture and table ... skipping for now |
2560 | | - continue |
2561 | | - |
2562 | 2550 | elif isinstance(item, SectionHeaderItem): |
2563 | 2551 |
|
2564 | 2552 | result += item.export_to_document_tokens( |
@@ -2664,10 +2652,6 @@ def get_text(text: str, max_text_len: int): |
2664 | 2652 | indent * level + f"item-{i} at level {level}: {item.label}: {text}" |
2665 | 2653 | ) |
2666 | 2654 |
|
2667 | | - elif isinstance(item, TextItem) and item.label in [DocItemLabel.CAPTION]: |
2668 | | - # captions are printed in picture and table ... skipping for now |
2669 | | - continue |
2670 | | - |
2671 | 2655 | elif isinstance(item, ListItem) and item.label in [DocItemLabel.LIST_ITEM]: |
2672 | 2656 | text = get_text(text=item.text, max_text_len=max_text_len) |
2673 | 2657 |
|
|
0 commit comments