Skip to content

Commit

Permalink
Update invenio_previewer/extensions/mistune.py
Browse files Browse the repository at this point in the history
Co-authored-by: Zacharias Zacharodimos <[email protected]>
  • Loading branch information
2 people authored and slint committed Jan 31, 2024
1 parent 699497b commit e9b3715
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions invenio_previewer/extensions/mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,7 @@ def render(file):
"""Render HTML from Markdown file content."""
with file.open() as fp:
encoding = detect_encoding(fp, default="utf-8")
try:
result = mistune.markdown(fp.read().decode(encoding))
return result
except Exception as e:
current_app.logger.exception(str(e))
return None
return mistune.markdown(fp.read().decode(encoding))


def can_preview(file):
Expand Down

0 comments on commit e9b3715

Please sign in to comment.