Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,12 +21,12 @@ def extract_text_markdown(doc):
|
|
21 |
if line_text:
|
22 |
elements.append((line_y, line_text))
|
23 |
elif b["type"] == 1: # Imagen
|
24 |
-
elements.append((y, "
|
25 |
|
26 |
# Ordenar por posici贸n vertical
|
27 |
elements.sort(key=lambda x: x[0])
|
28 |
|
29 |
-
#
|
30 |
previous_y = None
|
31 |
for y, content in elements:
|
32 |
if previous_y is not None and abs(y - previous_y) > 10:
|
@@ -34,7 +34,7 @@ def extract_text_markdown(doc):
|
|
34 |
markdown_output += content + "\n"
|
35 |
previous_y = y
|
36 |
|
37 |
-
markdown_output += "\n---\n\n"
|
38 |
|
39 |
return markdown_output.strip()
|
40 |
|
|
|
21 |
if line_text:
|
22 |
elements.append((line_y, line_text))
|
23 |
elif b["type"] == 1: # Imagen
|
24 |
+
elements.append((y, "[imagen]()")) # Enlace vac铆o
|
25 |
|
26 |
# Ordenar por posici贸n vertical
|
27 |
elements.sort(key=lambda x: x[0])
|
28 |
|
29 |
+
# Reconstruir con saltos
|
30 |
previous_y = None
|
31 |
for y, content in elements:
|
32 |
if previous_y is not None and abs(y - previous_y) > 10:
|
|
|
34 |
markdown_output += content + "\n"
|
35 |
previous_y = y
|
36 |
|
37 |
+
markdown_output += "\n---\n\n"
|
38 |
|
39 |
return markdown_output.strip()
|
40 |
|