KSh100 commited on
Commit
c866c44
·
verified ·
1 Parent(s): 22f3b84

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -55,10 +55,13 @@ def extract_images(soup, base_url):
55
  return images
56
 
57
  def format_detailed_output(structured_data, title):
58
- """Formats the structured data into a Markdown string."""
59
  result = f"### Title\n\n{title}\n\n"
60
  result += "### Texts\n\n"
61
- result += " ".join(structured_data["Texts"]) if structured_data["Texts"] else "No textual content found."
 
 
 
62
  result += "\n\n### Links\n\n"
63
  if structured_data["Links"]:
64
  result += "\n".join(f"[{link['Text']}]({link['URL']})" for link in structured_data["Links"])
 
55
  return images
56
 
57
  def format_detailed_output(structured_data, title):
58
+ """Formats the structured data into a Markdown string with each text, link, and image on a new line."""
59
  result = f"### Title\n\n{title}\n\n"
60
  result += "### Texts\n\n"
61
+ if structured_data["Texts"]:
62
+ result += "\n".join(structured_data["Texts"])
63
+ else:
64
+ result += "No textual content found."
65
  result += "\n\n### Links\n\n"
66
  if structured_data["Links"]:
67
  result += "\n".join(f"[{link['Text']}]({link['URL']})" for link in structured_data["Links"])