Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doc rendering is incorrect when :param has datatype dict(str,str) #9224

Closed
github-anurag opened this issue May 12, 2021 · 0 comments
Closed

Comments

@github-anurag
Copy link

Describe the bug
I have a parameter defined under docstring of a method as:-
:param dict(str, str) opc_meta: (optional)

Which is being incorrectly rendered in the generated docs as:-
str) opc_meta (dict(str,) –(optional)

To Reproduce
Create any method with the docstring containg the above param

Expected behavior
The param should be rendered in the generated docs as:-
opc_meta (dict(str,str)) – (optional)

Your project
sphinxTest.zip

Screenshots
Screen Shot 2021-05-12 at 12 30 50 PM
Screen Shot 2021-05-12 at 12 32 25 PM

Environment info

  • OS: Mac
  • Python version: 3.9.0
  • Sphinx version: 4.0.1
  • Sphinx extensions: ["sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.intersphinx", "autodocsumm"]
  • Extra tools: Browser Firefox.

Additional context
N/A

tk0miya added a commit to tk0miya/sphinx that referenced this issue May 15, 2021
…ng space

So far, DocFieldTransformer splits the field name for `:type:` and
`:param:` at the first whitespace.  But it does not allow to use
types containing whitespace (ex. `Dict[str, str]`).

This changes the spliting logic to divide the field name at the last
whitespace (a.k.a `rstrip()`).  It allows to use whitespaces on the
types.
@tk0miya tk0miya added this to the 4.1.0 milestone May 15, 2021
tk0miya added a commit that referenced this issue May 19, 2021
Fix #9224: info-field-list does not support a type containing space
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants