def md2html(file):
"""Use the markdown module to convert input to HTML"""
- with open(file, "r", encoding="utf-8") as input_file:
- return markdown.markdown(input_file.read(), extensions=['tables'])
+ try:
+ with open(file, "r", encoding="utf-8") as input_file:
+ return markdown.markdown(input_file.read(), extensions=['tables'])
+ except FileNotFoundError:
+ print(f"File \"{file}\" not found!")
+ exit(1)
def parse_html(html):