generated from hjess/PythonTemplateProject
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
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Has been cancelled
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user