Issue #1443 new

Syntax errors silently disable syntax coloring

Jean-Paul Calderone
created an issue

Consider a document like:

.. sourcecode:: http

   GET / HTTP/1.1
   Content-Type; application/json

   {"foo": "bar"}

Notice the syntax error on the Content-Type line - the use of ";" instead of ":".

When building this document with Sphinx, there is no indication that any errors have occurred:

$ make html
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.2
loading pickled environment... done
building [html]: targets for 1 source files that are out of date
updating environment: 0 added, 1 changed, 0 removed
reading sources... [100%] index                                                                                                                        
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
writing output... [100%] index                                                                                                                         
writing additional files... genindex search
copying static files... done
copying extra files... dumping search index... done
dumping object inventory... done
build succeeded.

Build finished. The HTML pages are in _build/html.

However the resulting document includes the source code with no syntax coloring. Fixing the syntax error fixes the syntax coloring but it's harder than necessary to do this with no indication of what or where the problem is. It's also easy to overlook this problem since the build will appear to succeed and only a later visual inspection will reveal the problem.

Comments (1)

  1. Log in to comment