markdowndata 0.0.1__tar.gz → 0.0.2__tar.gz
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.
- {markdowndata-0.0.1 → markdowndata-0.0.2}/PKG-INFO +2 -2
- {markdowndata-0.0.1 → markdowndata-0.0.2}/markdowndata/content_parser.py +4 -4
- {markdowndata-0.0.1 → markdowndata-0.0.2}/pyproject.toml +1 -1
- {markdowndata-0.0.1 → markdowndata-0.0.2}/LICENSE +0 -0
- {markdowndata-0.0.1 → markdowndata-0.0.2}/markdowndata/__init__.py +0 -0
- {markdowndata-0.0.1 → markdowndata-0.0.2}/markdowndata/process_markdown.py +0 -0
- {markdowndata-0.0.1 → markdowndata-0.0.2}/markdowndata/section_tree.py +0 -0
- {markdowndata-0.0.1 → markdowndata-0.0.2}/markdowndata/utils.py +0 -0
|
@@ -13,8 +13,8 @@ def detect_value_type(text: str) -> str | None:
|
|
|
13
13
|
if not text:
|
|
14
14
|
return None
|
|
15
15
|
|
|
16
|
-
# YAML detection (delimited by
|
|
17
|
-
if re.search(r'
|
|
16
|
+
# YAML detection (delimited by ===)
|
|
17
|
+
if re.search(r'===\s*\n(.*?)\n===', text, re.DOTALL):
|
|
18
18
|
return 'yaml_dict'
|
|
19
19
|
|
|
20
20
|
# Convert markdown to HTML and analyze for tables, lists, or text
|
|
@@ -31,10 +31,10 @@ def detect_value_type(text: str) -> str | None:
|
|
|
31
31
|
|
|
32
32
|
def yaml_dict_parser(text: str) -> dict:
|
|
33
33
|
"""
|
|
34
|
-
Parse YAML from a string (surrounded by
|
|
34
|
+
Parse YAML from a string (surrounded by ===) and returns it as a dictionary.
|
|
35
35
|
Assumes YAML is a block at the beginning of the text.
|
|
36
36
|
"""
|
|
37
|
-
match = re.search(r'
|
|
37
|
+
match = re.search(r'===\s*\n(.*?)\n===', text, re.DOTALL)
|
|
38
38
|
if match:
|
|
39
39
|
yaml_data = yaml.safe_load(match.group(1))
|
|
40
40
|
if yaml_data:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|