Long options in option lists are incorrectly parsed as definition lists

Nikolaus Rath avatarNikolaus Rath created an issue

When using sphinx 1.2b1 to render:

An option list with long options:

  --profile             Create profiling information. If you don't understand
                        this, then you don't need it.
  --compress <algorithm>[-<lvl>]
                        Compression algorithm and compression level to use
                        when storing new data. *algorithm* may be any of
                        `lzma`, `bzip2`, `zlib`, or none. *lvl* may be any
                        integer from 0 (fastest) to 9 (slowest). Default:
  --metadata-upload-interval <seconds>
                        Interval in seconds between complete metadata uploads.
                        Set to 0 to disable. Default: 24h.
  --threads <no>        Number of parallel upload threads to use (default:

It produces this warning:

/home/nikratio/tmp/sphinx/index.rst:19: WARNING: Option list ends without a blank line; unexpected unindent.
/home/nikratio/tmp/sphinx/index.rst:25: WARNING: Definition list ends without a blank line; unexpected unindent.

I don't think this is correct. According to http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#option-lists, long options may have a description starting on the next line.

It seems that Sphinx instead treats the long option as the beginning of a definition list.

I've attached a full testcase (run with 'make html')

Comments (3)

  1. Takayuki Shimizukawa

    Nikolaus Rath same warnings were reproduced with rst2html command. That means it is not an issue of the sphinx.

    BTW, --compress <algorithm>[-<lvl>] seems not to be a proper option-argument format. --compress <algorithm-lvl> is good (I know it is not an accurate expression for the option).

  2. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.