|
From: Günter M. <mi...@us...> - 2026-01-07 13:13:53
|
- **status**: open --> open-fixed
- **Comment**:
The fix is out.
Sorry for the confusion: I intended to publish 2 commits with one `git svn dcommit`
but only the first came through.
---
**[bugs:#517] content_offset in directives inside grid/simple tables are off**
**Status:** open-fixed
**Created:** Sat Dec 27, 2025 05:07 PM UTC by Felix Fontein
**Last Updated:** Tue Jan 06, 2026 08:59 PM UTC
**Owner:** nobody
When parsing a directive in a grid table or simple table, the directive's `content_offset` is off by one. (When nesting such a table in another such a table, it's off by one for every nesting level.)
For example, for the following code block directives, `content_offset` is always off from the real content line where the code block's content is in:
```rst
content_offset is off by 1:
+----------------------+
| .. code-block:: yaml |
| |
| - foo |
+----------------------+
content_offset is off by 2:
+------------------------+
|+----------------------+|
|| .. code-block:: yaml ||
|| ||
|| - foo ||
|+----------------------+|
+------------------------+
content_offset is off by 3:
+--------------------------+
|+------------------------+|
||+----------------------+||
||| .. code-block:: yaml |||
||| |||
||| - foo |||
||+----------------------+||
|+------------------------+|
+--------------------------+
content_offset is off by 1:
===== =====
col 1 col 2
===== =====
1 .. code-block:: yaml
- foo
===== =====
content_offset is off by 2:
===== =====
col 1 col 2
===== =====
1 ===== =====
col 1 col 2
===== =====
1 .. code-block:: yaml
- foo
===== =====
===== =====
```
(I've noticed this when registering an own code block directive to find the actual location - row and column - of the code block's contents, to be able to give more precise error messages when linting.)
---
Sent from sourceforge.net because doc...@li... is subscribed to https://sourceforge.net/p/docutils/bugs/
To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/docutils/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list. |