Skip to content

Drop in a screenshot and convert it to clean code (HTML/Tailwind/React/Vue)

Python

prettify code after image generation

Abi Raja640f41619c24
diff --git a/backend/image_generation.py b/backend/image_generation.py
index 5d4b81c4..336cc6e6 100644
--- a/backend/image_generation.py
+++ b/backend/image_generation.py
@@ -110,4 +110,5 @@ async def generate_images(code, image_cache):
print("Image generation failed for alt text:" + img.get("alt"))
# Return the modified HTML
- return str(soup)
+ # (need to prettify it because BeautifulSoup messes up the formatting)
+ return soup.prettify()