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

Fix references to production names. #8239

Merged
merged 1 commit into from Sep 27, 2020

Conversation

silene
Copy link
Contributor

@silene silene commented Sep 23, 2020

Feature or Bugfix

  • Bugfix

Purpose

When the user tries to align production rules, Sphinx gets confused by spaces around leading tokens. In the following, references to mygroup:bad1 and mygroup:bad2 are missing, while the one to mygroup:correct is present.

.. productionlist:: mygroup
   correct: `correct` | `bad1` | `bad2`
   bad1   : `correct` | `bad1` | `bad2`
      bad2: `correct` | `bad1` | `bad2`

Since it is useful to be able to align colons in a production list, this commit systematically strips leading and trailing whitespaces from the production name.

When the user tries to align production rules, Sphinx gets confused by
spaces around leading tokens. In the following, references to mygroup:bad1
and mygroup:bad2 are missing, while the one to mygroup:correct is present.

    .. productionlist:: mygroup
       correct: `correct` | `bad1` | `bad2`
       bad1   : `correct` | `bad1` | `bad2`
          bad2: `correct` | `bad1` | `bad2`

Since it is useful to be able to align colons in a production list, this
commit systematically strips leading and trailing whitespaces from the
production name.
@tk0miya tk0miya added this to the 3.3.0 milestone Sep 27, 2020
@tk0miya
Copy link
Member

tk0miya commented Sep 27, 2020

Fair enough. Thank you for your contribution!

@tk0miya tk0miya merged commit 574b3da into sphinx-doc:3.x Sep 27, 2020
tk0miya added a commit that referenced this pull request Sep 27, 2020
@silene silene deleted the fix_productionlist_references branch September 27, 2020 17:37
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants