Added try statement
This commit is contained in:
		
							parent
							
								
									73cc349405
								
							
						
					
					
						commit
						f05be8dca2
					
				| 
						 | 
					@ -17,8 +17,13 @@ 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):
 | 
				
			||||||
    with (article_path / "article.md").open("r") as f:
 | 
					    try:
 | 
				
			||||||
        markdown_data = f.read()
 | 
					        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'])
 | 
					    markdown_instance = markdown.Markdown(extensions=['meta', 'nl2br'])
 | 
				
			||||||
    html = markdown_instance.convert(markdown_data)
 | 
					    html = markdown_instance.convert(markdown_data)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue