--
This commit is contained in:
@@ -133,8 +133,7 @@ async def default_response(request: Request, full_path: str) -> Response:
|
|||||||
soup = BeautifulSoup(content, "html.parser")
|
soup = BeautifulSoup(content, "html.parser")
|
||||||
main = str(soup.find("main")) if soup.find("main") else content
|
main = str(soup.find("main")) if soup.find("main") else content
|
||||||
markdown = markitdown.convert_stream(io.BytesIO(main.encode("utf-8")), file_extension=".html")
|
markdown = markitdown.convert_stream(io.BytesIO(main.encode("utf-8")), file_extension=".html")
|
||||||
accesscounter.increase()
|
response = PlainTextResponse(markdown.text_content, status_code=200, media_type="text/markdown")
|
||||||
return PlainTextResponse(markdown.text_content, status_code=200, media_type="text/markdown")
|
|
||||||
else:
|
else:
|
||||||
if lightweight_mode:
|
if lightweight_mode:
|
||||||
source = templates.env.loader.get_source(templates.env, name)[0]
|
source = templates.env.loader.get_source(templates.env, name)[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user