markdowndata 0.1.0__py3-none-any.whl → 0.1.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.
@@ -9,7 +9,15 @@ def split_sections(text: str):
9
9
  Each section is identified by a header (e.g., #, ##, ###).
10
10
  """
11
11
  pattern = re.compile(r'^(?P<header>#+) (?P<title>[^\n]+)', re.MULTILINE)
12
- matches = list(pattern.finditer(text))
12
+ code_spans = [match.span() for match in re.finditer(r'```.*?```', text, re.DOTALL)]
13
+
14
+ def is_in_code_block(pos: int) -> bool:
15
+ for start, end in code_spans:
16
+ if start <= pos < end:
17
+ return True
18
+ return False
19
+
20
+ matches = [match for match in pattern.finditer(text) if not is_in_code_block(match.start())]
13
21
 
14
22
  sections = []
15
23
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: markdowndata
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: Tool to convert markdown tables into json objects
5
5
  License: MIT
6
6
  License-File: LICENSE
@@ -1,9 +1,9 @@
1
1
  markdowndata/__init__.py,sha256=jB8leosqIVXuO4LmU0KWn3OyJwgAtGKQBab9JUsbSQ0,172
2
2
  markdowndata/content_parser.py,sha256=x0ellHrZn6RZynUzwFGnxdzhS_Y2tL33zzvKrEwBSQc,5157
3
3
  markdowndata/process_markdown.py,sha256=jswWDnkApAMoT1gEXe2dfSB2pHt6U3vFuWrh6PgQjBY,1981
4
- markdowndata/section_tree.py,sha256=gn6PtzXcg4iN7F8Tldy3p3jrWe9IYqrcDEAjNm940ME,2722
4
+ markdowndata/section_tree.py,sha256=qCKZHO4mUJqdVD81tqeIlETRK4Esk6z9XZ90IM6LNOA,3032
5
5
  markdowndata/utils.py,sha256=jVTKEGZiLCKdv1cS-73iMf_GaXT6cBc3cl9tp_fjKOw,2040
6
- markdowndata-0.1.0.dist-info/METADATA,sha256=DIZoJgyceiwDGWp40bNI04xmk8uZExE1tWr8aYCeYEs,706
7
- markdowndata-0.1.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
8
- markdowndata-0.1.0.dist-info/licenses/LICENSE,sha256=K-k1T7XcwAVVmLsHhfWMye6r7p45xz3xwv5S5FBSyZE,1074
9
- markdowndata-0.1.0.dist-info/RECORD,,
6
+ markdowndata-0.1.1.dist-info/METADATA,sha256=hfZuT7qF8jNhqMIaycyfVzxxLqC9DPUKzfl0yX7LtM4,706
7
+ markdowndata-0.1.1.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
8
+ markdowndata-0.1.1.dist-info/licenses/LICENSE,sha256=K-k1T7XcwAVVmLsHhfWMye6r7p45xz3xwv5S5FBSyZE,1074
9
+ markdowndata-0.1.1.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.2.1
2
+ Generator: poetry-core 2.3.1
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any