Added try statement
This commit is contained in:
parent
73cc349405
commit
f05be8dca2
|
@ -17,9 +17,14 @@ def convert_case(string: str):
|
||||||
return string
|
return string
|
||||||
|
|
||||||
def article_to_xml(article_path: pathlib.Path):
|
def article_to_xml(article_path: pathlib.Path):
|
||||||
|
try:
|
||||||
with (article_path / "article.md").open("r") as f:
|
with (article_path / "article.md").open("r") as f:
|
||||||
markdown_data = f.read()
|
markdown_data = f.read()
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(e)
|
||||||
|
return
|
||||||
|
|
||||||
markdown_instance = markdown.Markdown(extensions=['meta', 'nl2br'])
|
markdown_instance = markdown.Markdown(extensions=['meta', 'nl2br'])
|
||||||
html = markdown_instance.convert(markdown_data)
|
html = markdown_instance.convert(markdown_data)
|
||||||
metadata = markdown_instance.Meta
|
metadata = markdown_instance.Meta
|
||||||
|
|
Loading…
Reference in a new issue