esciencecenter-digital-skills / software-support-essentials

https://esciencecenter-digital-skills.github.io/software-support-essentials/
Other
2 stars 1 forks source link

Fix cryptic 'endswith' error when an image is not set for chapter #16

Closed raar1 closed 1 year ago

raar1 commented 1 year ago

An unhelpful error was displayed in the browser if the 'Chapter' line in a story's markdown did not specify an image file.

For example: :::Chapter{headline="Citation"} instead of :::Chapter{headline="Citation" image="ghlogo.png"}

Firefox gave a somewhat understandable error but in Chromium it was not so obvious. I have added a slightly more graceful error handling, in which the page is still able to render, but the media pane div displays an error and a potential fix.

Tested in both firefox 109.0.1 and chromium 109.0.5414.119

Fixes https://github.com/esciencecenter-digital-skills/software-support-essentials/issues/9