Issues

Issue #1211 invalid

Long options in option lists are incorrectly parsed as definition lists

Nikolaus 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:
                        `lzma-6`
  --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:
                        auto).

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 (4)

  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. Nikolaus Rath reporter

    Hu? The way the list is parsed is against the RST specificiation. How does the fact that rst2html seems to have the same bug make this not a bug?

  3. Log in to comment