Added try statement

This commit is contained in:
vanten-s 2023-08-05 10:38:54 +02:00
parent 73cc349405
commit f05be8dca2
Signed by: vanten-s
GPG key ID: DE3060396884D3F2

View file

@ -17,9 +17,14 @@ def convert_case(string: str):
return string
def article_to_xml(article_path: pathlib.Path):
try:
with (article_path / "article.md").open("r") as f:
markdown_data = f.read()
except Exception as e:
print(e)
return
markdown_instance = markdown.Markdown(extensions=['meta', 'nl2br'])
html = markdown_instance.convert(markdown_data)
metadata = markdown_instance.Meta