Skip to content

Sphinx 1.3.5: Could not parse literal_block as "language" #2264

@stevepiercy

Description

@stevepiercy

The following might not be a bug, but it is a changed behavior that enforces stricter syntax, and should be noted.

How to reproduce

For this code sample (and several others):

.. code-block:: ini
   :linenos:

   [app:main]
   ...
   pyramid.includes =
       pyramid_debugtoolbar

Sphinx 1.3.4 yielded no errors. Upgrading to 1.3.5 and attempting to build HTML causes the following error:

/home/travis/build/Pylons/pyramid/docs/narr/project.rst:434: WARNING: Could not parse literal_block as "ini". highlighting skipped.

How to Fix/Workaround

Use a comment for elided output instead of a literal .... It appears that one can no longer use incorrect syntax for a given language for highlighting.

.. code-block:: ini
   :linenos:

   [app:main]
   # ... elided configuration
   pyramid.includes =
       pyramid_debugtoolbar

The screenshot compares two examples, where the first is highlighted but the second is not.

google chrome005

I noticed that this shows up for javascript or posh syntaxes, too.

Possibly related to #2262.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions