Issues

Issue #519 wontfix

Trailing underscores in parameter names are dropped

Anonymous created an issue

When documenting Python parameters with trailing underscores:

{{{

!python

def example(str_): """Notice that the parameter str_ has a trailing underscore.

:param str_: Unfortunately, it gets dropped in the resulting HTML.
"""

}}}

The resulting HTML documentation completely omits the trailing underscore.

Comments (7)

  1. Daniel Neuhäuser

    I think I know what causes this issue. Docutils interprets the trailing underscore in str_ as markup for a link named str, therefore it drops the underscore. If it is escaped it works.

    def example(str_):
        """Notice that the parameter `str_` has a trailing underscore.
    
        :param str\_: Unfortunately, it gets dropped in the resulting HTML if it's not escaped.
        """
    

    I'm not sure how to fix this or if it can be fixed at all in Sphinx.

  2. Log in to comment