-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
disable docutils #188
Comments
You can simply uninstall docutils for the time being. To fix the bug, if rendering fails, we should show the raw markup plus a warning. |
Uninstalling docutils is not solution, it is installed, because it is needed. Warning can be logged, not need to be shown. |
Sounds good! PR welcome :-) |
I see now, that klaus has not logging enabled, but solving render error is trivial (i am sorry, no PR): --- highlighting.py.bak 2017-06-22 18:04:33.170205010 +0200
+++ highlighting.py 2017-06-22 18:27:23.421068022 +0200
@@ -85,7 +85,11 @@
:param ctags_baseurl: base url used for source code hyperlinks, str
"""
if render_markup and markup.can_render(filename):
- return markup.render(filename, code)
+ try:
+ return markup.render(filename, code)
+ except Exception as err:
+ # continue on any rendering error
+ print ("WARNING: Markup rendering fails for %s (%s)" % (filename, err))
try:
lexer = get_lexer_for_filename(filename, code) |
I think warnings should at the very least also be disabled to the web page. In many cases, whoever runs codehosting is not the person that writes the rst. |
Hi,
i tried your SW (1.2.0) and it seems to work, but when i want to see my Sphinx's repo i have problem to see the Sphinx's RST files. The Sphinx itself uses superset of docutils directives, then not all files can be rendered by docutils. On these files klaus give me traceback and returns 500 (Internal server error). The traceback itself is not important, because the docutils errors are expected (some simple pages are rendered OK).
Please, make using particular renderer as optional, eg. by disabling it via command line, or allow renderer to fail, with failback to display of the plain/highlighted source.
The text was updated successfully, but these errors were encountered: