Lidt CSS fixeri og ja BS4 til at fixe tags
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Has been cancelled

This commit is contained in:
2024-12-21 00:15:58 +01:00
parent 7d55191d91
commit bd2fef9b6c
23 changed files with 5047 additions and 2039 deletions

View File

@@ -1,4 +1,7 @@
import os
from bs4 import BeautifulSoup
from app.services.markdown_render import render_markdown_with_jinja # Your custom renderer
from jinja2 import Environment, FileSystemLoader
@@ -69,7 +72,9 @@ class MarkdownProcessor:
# Write the rendered HTML to index.html
os.makedirs(directory_path, exist_ok=True)
with open(output_file, "w", encoding="utf-8") as output:
output.write(rendered_html)
soup = BeautifulSoup( rendered_html, 'html.parser' )
cleaned_html = soup.prettify(formatter="html5")
output.write(cleaned_html)
print(f"Generated: {output_file}")
def run(self):