spiderforce4ai 1.9__tar.gz → 2.0__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/PKG-INFO +1 -1
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/pyproject.toml +1 -1
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/setup.py +1 -1
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai/__init__.py +13 -6
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai.egg-info/PKG-INFO +1 -1
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/README.md +0 -0
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/setup.cfg +0 -0
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai.egg-info/SOURCES.txt +0 -0
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai.egg-info/dependency_links.txt +0 -0
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai.egg-info/requires.txt +0 -0
- {spiderforce4ai-1.9 → spiderforce4ai-2.0}/spiderforce4ai.egg-info/top_level.txt +0 -0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "spiderforce4ai"
|
7
|
-
version = "
|
7
|
+
version = "2.0"
|
8
8
|
description = "Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service"
|
9
9
|
readme = "README.md"
|
10
10
|
authors = [{name = "Piotr Tamulewicz", email = "pt@petertam.pro"}]
|
@@ -48,17 +48,24 @@ def extract_metadata_headers(markdown: str, url: str = '') -> str:
|
|
48
48
|
# Extract metadata within the block
|
49
49
|
if in_metadata:
|
50
50
|
if ':' in line:
|
51
|
-
key, value = line.split(':', 1)
|
52
|
-
key = key.
|
53
|
-
|
51
|
+
key, value = [part.strip() for part in line.split(':', 1)]
|
52
|
+
key = key.lower()
|
53
|
+
|
54
|
+
# Handle multi-line values
|
55
|
+
if value.startswith('>'):
|
56
|
+
value = value[1:].strip()
|
57
|
+
j = i + 1
|
58
|
+
while j < len(lines) and lines[j].strip() and not lines[j].strip() == '---':
|
59
|
+
value += ' ' + lines[j].strip()
|
60
|
+
j += 1
|
54
61
|
|
55
62
|
if key == 'title':
|
56
63
|
metadata['title'] = value
|
57
|
-
elif key == 'description':
|
64
|
+
elif key == 'description' or key == 'meta_description':
|
58
65
|
metadata['description'] = value
|
59
|
-
elif key == 'canonical_url':
|
66
|
+
elif key == 'canonical_url' or key == 'canonical':
|
60
67
|
metadata['canonical_url'] = value
|
61
|
-
elif key == 'language':
|
68
|
+
elif key == 'language' or key == 'lang':
|
62
69
|
metadata['language'] = value
|
63
70
|
|
64
71
|
# Add formatted metadata section with URL first
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|