docling-core 2.12.0__py3-none-any.whl → 2.12.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of docling-core might be problematic. Click here for more details.

@@ -550,17 +550,18 @@ class ExportedCCSDocument(
550
550
 
551
551
  elif (
552
552
  isinstance(item, Table)
553
- and item.data
553
+ and (item.data or item.text)
554
554
  and item_type in main_text_labels
555
555
  ):
556
556
 
557
557
  md_table = ""
558
558
  table = []
559
- for row in item.data:
560
- tmp = []
561
- for col in row:
562
- tmp.append(col.text)
563
- table.append(tmp)
559
+ if item.data is not None:
560
+ for row in item.data:
561
+ tmp = []
562
+ for col in row:
563
+ tmp.append(col.text)
564
+ table.append(tmp)
564
565
 
565
566
  if len(table) > 1 and len(table[0]) > 0:
566
567
  try:
@@ -579,7 +580,9 @@ class ExportedCCSDocument(
579
580
  if item.text:
580
581
  markdown_text = item.text
581
582
  if not strict_text:
582
- markdown_text += "\n\n" + md_table
583
+ markdown_text += (
584
+ "\n\n" if len(markdown_text) > 0 else ""
585
+ ) + md_table
583
586
 
584
587
  elif isinstance(item, Figure) and item_type in main_text_labels:
585
588
 
@@ -587,7 +590,9 @@ class ExportedCCSDocument(
587
590
  if item.text:
588
591
  markdown_text = item.text
589
592
  if not strict_text:
590
- markdown_text += f"\n{image_placeholder}"
593
+ markdown_text += (
594
+ "\n" if len(markdown_text) > 0 else ""
595
+ ) + image_placeholder
591
596
 
592
597
  if markdown_text:
593
598
  md_texts.append(markdown_text)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.12.0
3
+ Version: 2.12.1
4
4
  Summary: A python library to define and validate data types in Docling.
5
5
  Home-page: https://ds4sd.github.io/
6
6
  License: MIT
@@ -36,7 +36,7 @@ docling_core/types/legacy_doc/base.py,sha256=aBKBunw6M6nvEq4lqP1cfFWK3GpGa6PXwNQ
36
36
  docling_core/types/legacy_doc/doc_ann.py,sha256=CIQHW8yzu70bsMR9gtu7dqe4oz603Tq2eDDt9sh-tYo,1203
37
37
  docling_core/types/legacy_doc/doc_ocr.py,sha256=FfFqHAyMSbFt5cKeE7QLcxS0qUweBilBJoN9CH2TsQs,1394
38
38
  docling_core/types/legacy_doc/doc_raw.py,sha256=LrvQ9DhNjBRy98p_F9PUyHZeTGAxMKWqJzY4WJ7v-xs,3895
39
- docling_core/types/legacy_doc/document.py,sha256=A_cTYOjx6pNIICpOUm09YsfwPrIGDEZTKdetb2fx4PM,24273
39
+ docling_core/types/legacy_doc/document.py,sha256=AW8AIBM19k-HtTmXPsFKagqd6gi9THJdB4RsPb1C5F0,24534
40
40
  docling_core/types/legacy_doc/tokens.py,sha256=uU_MYW_p7ypf7eYICFBvxdnVaPZ7CQnvZmbJ6oPrtEA,6134
41
41
  docling_core/types/nlp/__init__.py,sha256=hGcztAeVK7xkRBqRRvc4zbY4PGeJ0r0QrEsetnSx9nI,119
42
42
  docling_core/types/nlp/qa.py,sha256=TyZjubqkEoREv0YzmuLKlq4WW_TnJNj7BoBY1_r2a1E,2731
@@ -56,8 +56,8 @@ docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2ty
56
56
  docling_core/utils/legacy.py,sha256=xfp7U0JqjI60K3loWiNTk8w08_KfCUzTb2MNULBOIz4,24396
57
57
  docling_core/utils/validate.py,sha256=aQ11UbFyl8iD_N7yTTZmm_VVeXz8KcCyn3GLXgkfYRM,2049
58
58
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
59
- docling_core-2.12.0.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
60
- docling_core-2.12.0.dist-info/METADATA,sha256=Pvm-bnXtIVhPapkhV2z9ytH7CSskqmRtdoBroq-9gIU,5744
61
- docling_core-2.12.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
62
- docling_core-2.12.0.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
63
- docling_core-2.12.0.dist-info/RECORD,,
59
+ docling_core-2.12.1.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
60
+ docling_core-2.12.1.dist-info/METADATA,sha256=7GQuAsiJL6EGBIEjeiX-XQs7gELqhCGWsNeSrsGm5Kk,5744
61
+ docling_core-2.12.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
62
+ docling_core-2.12.1.dist-info/entry_points.txt,sha256=oClcdb2L2RKx4jdqUykY16Kum_f0_whwWhGzIodyidc,216
63
+ docling_core-2.12.1.dist-info/RECORD,,