docling-core 2.2.0__py3-none-any.whl → 2.2.2__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.

@@ -129,8 +129,8 @@ class HierarchicalChunker(BaseChunker):
129
129
  table_df.index = table_df.index + 1
130
130
  table_df = table_df.sort_index()
131
131
 
132
- rows = [item.strip() for item in table_df.iloc[:, 0].to_list()]
133
- cols = [item.strip() for item in table_df.iloc[0, :].to_list()]
132
+ rows = [str(item).strip() for item in table_df.iloc[:, 0].to_list()]
133
+ cols = [str(item).strip() for item in table_df.iloc[0, :].to_list()]
134
134
 
135
135
  nrows = table_df.shape[0]
136
136
  ncols = table_df.shape[1]
@@ -1291,6 +1291,18 @@ class DoclingDocument(BaseModel):
1291
1291
  mdtext = re.sub(
1292
1292
  r"\n\n\n+", "\n\n", mdtext
1293
1293
  ) # remove cases of double or more empty lines.
1294
+
1295
+ # Our export markdown doesn't contain any emphasis styling:
1296
+ # Bold, Italic, or Bold-Italic
1297
+ # Hence, any underscore that we print into Markdown is coming from document text
1298
+ # That means we need to escape it, to properly reflect content in the markdown
1299
+ def escape_underscores(text):
1300
+ # Replace "_" with "\_" only if it's not already escaped
1301
+ escaped_text = re.sub(r"(?<!\\)_", r"\_", text)
1302
+ return escaped_text
1303
+
1304
+ mdtext = escape_underscores(mdtext)
1305
+
1294
1306
  return mdtext
1295
1307
 
1296
1308
  def export_to_text( # noqa: C901
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: docling-core
3
- Version: 2.2.0
3
+ Version: 2.2.2
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
@@ -16,12 +16,12 @@ docling_core/search/package.py,sha256=Lz2ml2eDy5t0ZimnGTq-DXHAn-f18w0bn4H5xrhs75
16
16
  docling_core/transforms/__init__.py,sha256=P81y_oqkiTN4Ld5crh1gQ6BbHqqR6C6nBt9ACDd57ds,106
17
17
  docling_core/transforms/chunker/__init__.py,sha256=sSSTnt7ZCt8Og1e0jhApNTtA0pyyHyzwcl8yXFLb2J8,292
18
18
  docling_core/transforms/chunker/base.py,sha256=iPouZOJ3cYWvai4P0Gpd3QmsTKQuY5fFUXzTMk_XNmE,1571
19
- docling_core/transforms/chunker/hierarchical_chunker.py,sha256=-wZrQAPMiROb9yKiSN3eGqtD13tjcDVAiDUz971Q8PI,8087
19
+ docling_core/transforms/chunker/hierarchical_chunker.py,sha256=uG7nNoUCFqWeQAKydQg731JYJ9sayUe4J48nMF0VHE8,8097
20
20
  docling_core/types/__init__.py,sha256=MVRSgsk5focwGyAplh_TRR3dEecIXpd98g_u3zZ5HXo,260
21
21
  docling_core/types/base.py,sha256=PusJskRVL19y-hq0BgXr5e8--QEqSqLnFNJ8UbOqW88,8318
22
22
  docling_core/types/doc/__init__.py,sha256=bEL4zKVOG7Wxm6xQrgF58mu-Teds9aSavuEAKVNhrTU,639
23
23
  docling_core/types/doc/base.py,sha256=zvx631U_yQCcJam83hNdDanXEYnO3eN-CCw9vDr6S-I,4442
24
- docling_core/types/doc/document.py,sha256=RMG_iCgKJm71TFVRBrRKzST-Nb9DCgluji9O0BhPt4M,51373
24
+ docling_core/types/doc/document.py,sha256=SrOXpO6iCIYFkhWW-pksd4C4PeJ2jubKI5m34K_lTac,51902
25
25
  docling_core/types/doc/labels.py,sha256=mzmSd072A-qW3IThswHxwIHV8IoyTCbHHlNOrisinRA,1335
26
26
  docling_core/types/gen/__init__.py,sha256=C6TuCfvpSnSL5XDOFMcYHUY2-i08vvfOGRcdu6Af0pI,124
27
27
  docling_core/types/gen/generic.py,sha256=l4CZ4_Lb8ONG36WNJWbKX5hGKvTh_yU-hXp5hsm7uVU,844
@@ -49,8 +49,8 @@ docling_core/utils/generate_docs.py,sha256=BdKAoduWXOc7YMvcmlhjoJOFlUxij1ybxglj6
49
49
  docling_core/utils/generate_jsonschema.py,sha256=uNX1O5XnjyB5nA66XqZXTt3YbGuR2tyi_OhHepHYtZg,1654
50
50
  docling_core/utils/validate.py,sha256=3FmnxnKTDZC5J9OGxCL3U3DGRl0t0bBV1NcySXswdas,2031
51
51
  docling_core/utils/validators.py,sha256=azcrndLzhNkTWnbFSu9shJ5D3j_znnLrIFA5R8hzmGU,2798
52
- docling_core-2.2.0.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
53
- docling_core-2.2.0.dist-info/METADATA,sha256=3iAaT-ENDYeRWqBtefYohekCqiiXM-AFkJw3lFi3s8o,5432
54
- docling_core-2.2.0.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
55
- docling_core-2.2.0.dist-info/entry_points.txt,sha256=jIxlWv3tnO04irlZc0zfhqJIgz1bg9Hha4AkaLWSdUA,177
56
- docling_core-2.2.0.dist-info/RECORD,,
52
+ docling_core-2.2.2.dist-info/LICENSE,sha256=2M9-6EoQ1sxFztTOkXGAtwUDJvnWaAHdB9BYWVwGkIw,1087
53
+ docling_core-2.2.2.dist-info/METADATA,sha256=680OW3ffU0R_QL5UdvoUASJBOyLj7YKlfeDcftd3Kkw,5432
54
+ docling_core-2.2.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
55
+ docling_core-2.2.2.dist-info/entry_points.txt,sha256=jIxlWv3tnO04irlZc0zfhqJIgz1bg9Hha4AkaLWSdUA,177
56
+ docling_core-2.2.2.dist-info/RECORD,,