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
0einstein0 and zzacharo authored Jan 29, 2024
1 parent 3c91ad1 commit 29dccf9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions invenio_previewer/extensions/mistune.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,15 @@ def can_preview(file):

def preview(file):
"""Render Markdown."""
content = render(file)
if content is not None:
try:
content = render(file)
return render_template(
"invenio_previewer/mistune.html",
file=file,
content=content,
js_bundles=current_previewer.js_bundles,
css_bundles=current_previewer.css_bundles,
)
else:
except Exception as e:
current_app.logger.exception(str(e))
return render_template("invenio_previewer/default.html")

0 comments on commit 29dccf9

Please sign in to comment.