spiderforce4ai 1.9__py3-none-any.whl → 2.0__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
@@ -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.strip().lower()
53
- value = value.strip()
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: spiderforce4ai
3
- Version: 1.9
3
+ Version: 2.0
4
4
  Summary: Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service
5
5
  Home-page: https://petertam.pro
6
6
  Author: Piotr Tamulewicz
@@ -0,0 +1,5 @@
1
+ spiderforce4ai/__init__.py,sha256=CiZBCoRGCfu8587NbW_rtU6kFZEC0R7i_lZwJLesH3M,35975
2
+ spiderforce4ai-2.0.dist-info/METADATA,sha256=nOYUQWRl46UwW3HybozwqcFdc2JPotPLXsEBiL4GuqI,7183
3
+ spiderforce4ai-2.0.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ spiderforce4ai-2.0.dist-info/top_level.txt,sha256=Kth7A21Js7DCp0j5XBBi-FE45SCLouZkeNZU__Yr9Yk,15
5
+ spiderforce4ai-2.0.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- spiderforce4ai/__init__.py,sha256=JL3APcu08DJWqeVBssPODQ8zqZdislI-qiOah_7xnus,35564
2
- spiderforce4ai-1.9.dist-info/METADATA,sha256=St2DWVpNEWX22A9x7aizkUtRtTOk8tnva0izcXRNL5o,7183
3
- spiderforce4ai-1.9.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
- spiderforce4ai-1.9.dist-info/top_level.txt,sha256=Kth7A21Js7DCp0j5XBBi-FE45SCLouZkeNZU__Yr9Yk,15
5
- spiderforce4ai-1.9.dist-info/RECORD,,