Errors rendering markdown for some projects
Summary
Some wiki pages fail to render, and this results as 500 Internal Server Error responses.
Steps to reproduce
This seems to be related to the content of some pages, some examples are some pages found in this project:
https://gitlab.com/trustable/documents/-/wikis/pages?page=6
Particularly:
- https://gitlab.com/trustable/documents/-/wikis/trustable-software-method
- https://gitlab.com/trustable/documents/-/wikis/validating-schemas-in-yaml
at least. Other pages in this wiki render successfully, eg:
These pages all have the non-standard markdown extension mdwn
Current hypothesis: changing the extension on the file or handling it in the rendering pipeline would fix the problem
Example Project
Some of the pages at https://gitlab.com/trustable/documents/-/wikis/pages
What is the current bug behavior?
Attempts to view wiki pages produce 500 Internal Server Error
What is the expected correct behavior?
If the wiki fails to render, the raw view should be presented instead, with options to edit. Ideally we would even want to know why it failed to render so that the user can fix it. If, as is suspected, the reason is that the user chose an extension we cannot handle, they should be invited to choose a valid one.
Relevant logs and/or screenshots
An example backtrace:
lib/gitlab/other_markup.rb:11:in `render'
app/helpers/markup_helper.rb:274:in `other_markup_unsafe'
app/helpers/markup_helper.rb:154:in `markup_unsafe'
app/helpers/markup_helper.rb:139:in `render_wiki_content'
...
[ framework stack-frames elided ]
With the message: LoadError: no suitable markdown gem found
Output of checks
This bug happens on GitLab.com
Possible fixes
Handle .mdwn extension, either by fallback or by editing.