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

Add content_offset parameter to nested_parse_with_titles #11147

Merged

Commits on Jan 22, 2023

  1. Add content_offset parameter to nested_parse_with_titles

    Previously, `nested_parse_with_titles` always passed `0` as the input
    offset when invoking `nested_parse`.  When parsing the content of a
    directive, as is a common use case for `nested_parse_with_titles`,
    this leads to incorrect source file/line number information, as it
    does not take into account the directive's `content_offset`, which is
    always non-zero.
    
    This issue affects *all* object descriptions due to sphinx-doc#10887.  It also
    affects the `ifconfig` extension.
    
    The `py:module` and `js:module` directives employed a workaround for
    this issue, by wrapping the calls to `nested_parse_with_title` with
    `switch_source_input`.  That worked, but was more complicated (and
    likely less efficient) than necessary.
    
    This commit adds an optional `content_offset` parameter to
    `nested_parse_with_titles`, and fixes callers to pass the appropriate
    content offset when needed.
    
    This commit eliminates the now-unnecessary calls to
    `switch_source_input` and instead specifies the correct `content_offset`.
    jbms committed Jan 22, 2023
    Copy the full SHA
    7879ab1 View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    fbbe561 View commit details
    Browse the repository at this point in the history
  3. Copy the full SHA
    c498345 View commit details
    Browse the repository at this point in the history

Commits on Feb 15, 2023

  1. Copy the full SHA
    9bc00bd View commit details
    Browse the repository at this point in the history