Skip to content

Commit 194fbb9

Browse files
authored
fix: correct indentation process around exception_section (#260)
1 parent 1beb7ee commit 194fbb9

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

generate_guideline_templates.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ def norm(value: str) -> str:
6969
indented_compliant_ex = indent(compliant_example.strip(), " " * 13)
7070
indented_non_compliant_ex = indent(non_compliant_ex.strip(), " " * 13)
7171

72-
# Build the exception section only if exceptions content is provided
72+
# Build optional exception section
7373
exception_section = ""
7474
if exceptions and exceptions.strip():
7575
exception_section = f"""
76-
**Exception**
76+
**Exception**
7777
78-
{exceptions.strip()}
79-
"""
78+
{exceptions.strip()}
79+
"""
8080

8181
guideline_text = dedent(f"""
8282
.. guideline:: {guideline_title.strip()}
@@ -90,7 +90,9 @@ def norm(value: str) -> str:
9090
:tags: {tags}
9191
9292
{amplification.strip()}
93-
{exception_section}
93+
94+
{exception_section.strip()}
95+
9496
.. rationale::
9597
:id: {rationale_id}
9698
:status: {norm(status)}

scripts/guideline_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def get(key):
184184
md_to_rst(get("compliant_example_prose")), " " * 16
185185
)
186186

187-
# Process exceptions field - convert to RST and indent appropriately
187+
# Process exceptions field - convert MD to RST and pre-indent for multi-line support
188188
exceptions_raw = get("exceptions")
189189
exceptions_text = ""
190190
if exceptions_raw:

0 commit comments

Comments
 (0)