Skip to content

Fix RST directive handling to preserve blank separator lines#200

Merged
hoe-jo merged 1 commit into
bmw-software-engineering:mainfrom
Shubhangi-Nikam26:main
Jun 17, 2026
Merged

Fix RST directive handling to preserve blank separator lines#200
hoe-jo merged 1 commit into
bmw-software-engineering:mainfrom
Shubhangi-Nikam26:main

Conversation

@Shubhangi-Nikam26

Copy link
Copy Markdown
Contributor

Description

Fix RST directive handling to support blank separator lines within directive bodies.

Problem

Directives like .. list-table:: require blank lines to separate rows, but the preprocessor was exiting directive mode on empty lines. This caused malformed RST output where directive content was not properly nested.

Solution

Preserve directive mode when encountering blank lines while still properly exiting code block mode. The directive block remains active until indentation drops back to the base level, allowing blank separator lines to be included in the directive body.

Changes

  • Updated comment in _preprocess_description() to clarify behavior
  • Removed unconditional in_directive = False assignment on empty lines
  • Directive mode now only exits when indentation returns to base level

Testing

This change improves handling of RST directives in TRLC description fields, particularly for structured content like tables with multi-row formatting.

@Shubhangi-Nikam26 Shubhangi-Nikam26 requested a review from a team as a code owner June 16, 2026 07:17
Keep directive mode active when encountering empty lines, allowing
directives like ``.. list-table::`` to properly contain blank lines
as row separators without prematurely exiting directive processing.
@hoe-jo hoe-jo merged commit 31964fa into bmw-software-engineering:main Jun 17, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants