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.
@@ -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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "spiderforce4ai"
7
- version = "1.9"
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"}]
@@ -3,7 +3,7 @@ from setuptools import setup, find_packages
3
3
 
4
4
  setup(
5
5
  name="spiderforce4ai",
6
- version="1.9",
6
+ version="2.0",
7
7
  author="Piotr Tamulewicz",
8
8
  author_email="pt@petertam.pro",
9
9
  description="Python wrapper for SpiderForce4AI HTML-to-Markdown conversion service",
@@ -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
File without changes
File without changes