Jeremy Maitin-Shepard
8de6638697
Add `content_offset parameter to nested_parse_with_titles` ( #11147 )
...
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 GH-10887. It also
affects the ``sphinx.ext.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``.
2023-02-15 05:45:28 +00:00
..
2020-11-15 18:25:39 +01:00
2022-09-24 15:10:57 +01:00
2023-01-06 23:52:19 +01:00
2020-11-20 19:43:02 +01:00
2023-01-31 22:10:48 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2022-09-27 18:31:47 +01:00
2022-09-26 17:50:57 +01:00
2022-04-27 03:04:19 +01:00
2023-01-31 18:30:43 +00:00
2023-01-10 14:53:17 +00:00
2023-01-04 05:46:23 +00:00
2023-01-10 14:53:17 +00:00
2023-01-10 16:00:59 +00:00
2023-01-01 20:48:37 +00:00
2022-10-13 13:16:17 +01:00
2023-01-10 14:53:17 +00:00
2022-04-27 03:04:19 +01:00
2022-09-27 18:31:47 +01:00
2022-04-27 03:11:08 +01:00
2022-02-20 03:13:45 +00:00
2023-01-21 11:11:03 +01:00
2022-04-27 03:04:19 +01:00
2022-12-30 00:06:11 +00:00
2023-02-15 05:45:28 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2023-01-07 18:31:15 +00:00
2023-01-07 18:31:15 +00:00
2023-02-15 05:45:28 +00:00
2023-02-15 05:45:28 +00:00
2023-01-07 18:31:15 +00:00
2023-01-07 18:31:15 +00:00
2023-02-11 13:17:18 +00:00
2022-09-24 00:31:26 +01:00
2022-09-13 20:20:02 +01:00
2022-06-16 19:50:01 +01:00
2022-06-16 19:33:55 +01:00
2022-07-04 18:48:44 -07:00
2022-10-17 22:39:09 +01:00
2023-01-02 18:57:04 +00:00
2023-01-02 18:57:04 +00:00
2023-01-02 18:57:04 +00:00
2022-06-16 19:33:55 +01:00
2022-09-23 17:27:00 +01:00
2022-09-27 18:31:47 +01:00
2023-01-02 18:57:04 +00:00
2022-02-20 03:13:45 +00:00
2023-01-01 20:48:37 +00:00
2022-09-27 18:31:47 +01:00
2022-05-23 02:04:03 +09:00
2023-01-02 18:57:04 +00:00
2022-06-16 21:07:25 +01:00
2023-01-07 18:31:15 +00:00
2022-04-27 03:04:19 +01:00
2022-12-29 23:53:48 +00:00
2022-02-20 03:13:45 +00:00
2022-10-05 14:47:16 +01:00
2022-04-27 03:04:19 +01:00
2022-09-27 18:31:47 +01:00
2023-02-15 05:45:28 +00:00
2022-10-17 22:39:09 +01:00
2023-01-07 18:31:15 +00:00
2023-01-07 18:31:15 +00:00
2023-01-04 05:46:23 +00:00
2023-01-07 18:31:15 +00:00
2023-02-15 04:34:10 +00:00
2022-08-06 18:31:14 +02:00
2022-04-27 03:04:19 +01:00
2023-01-02 00:01:14 +00:00
2022-02-20 03:13:45 +00:00
2022-09-25 00:10:59 +01:00
2023-01-07 18:31:15 +00:00
2022-02-20 03:13:45 +00:00
2022-12-30 00:57:51 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2022-04-27 03:11:08 +01:00
2022-09-27 18:31:47 +01:00
2022-06-16 21:37:46 +01:00
2022-09-27 18:31:47 +01:00
2022-12-29 23:53:48 +00:00
2022-02-20 03:13:45 +00:00
2023-02-15 05:26:10 +00:00
2023-02-15 04:34:10 +00:00
2022-09-27 18:31:47 +01:00
2022-04-27 03:04:19 +01:00
2022-06-16 21:05:37 +01:00
2022-04-27 03:11:08 +01:00
2022-04-27 03:04:19 +01:00
2022-06-01 18:10:55 +01:00
2023-01-07 18:31:15 +00:00
2022-02-20 03:13:45 +00:00
2023-01-07 18:31:15 +00:00
2022-06-26 14:43:05 +01:00
2022-04-27 03:11:08 +01:00
2023-01-07 18:31:15 +00:00
2023-01-07 18:31:15 +00:00
2022-02-20 03:13:45 +00:00
2022-06-16 19:51:49 +01:00
2022-07-23 21:19:35 +01:00
2023-01-07 18:31:15 +00:00
2022-02-20 03:13:45 +00:00
2022-02-20 03:13:45 +00:00
2023-01-07 18:31:15 +00:00
2023-01-03 22:36:54 +00:00
2022-09-27 18:31:47 +01:00
2022-02-20 03:13:45 +00:00
2023-01-31 18:30:43 +00:00
2021-12-11 11:38:24 +09:00