sphinx-doc/sphinx

Substitutions not replaced in generated index

Closed this issue · 2 comments

When using a substitution in an index term, the substitution is placed literally in the created index.

Example:

    .. index::
        single: |sphinx|-objects; PART

creates an index entry in HTML like:

    <dt>|sphinx|-objects</dt>
    <dd><dl><dt><a href="...">PART</a></dt>
    ....

The substitution should also be done in the generated index. It does not matter if the substitutions are defined in the same file or via a file included in rst_epilog, same result in both cases.


Found this issue after investigating and would also like to see this enhancement implemented.

substitution is only available inside narrative paragraphs. It means nobody can't use it on directive contents or parameters. It is described as inline markups in spec of reStructuredText.
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#substitution-references

IMO, we should not break the compatibility of reST. So -1 for this.