Skip to content

Commit 48179a0

Browse files
Fix nested tab indentation in response templates (pymdownx regression)
After issue #35 introduced a response-code tab wrapper (=== "200 OK"), content-type tabs became doubly nested. The `{% include "partial/content-examples.html" %}` directive inside the 8-space content-type tab context rendered at column 0, breaking the indentation chain so that subsequent `??? hint` admonition blocks were not recognised as belonging to the tab content. Fix: inline the content-examples rendering directly in request-responses.html with proper 8-space indentation so all content (code blocks, warnings, admonitions) sits correctly inside the nested tab structure. Regenerated snapshots for example1–example4-split. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7b2f591 commit 48179a0

5 files changed

Lines changed: 1295 additions & 1288 deletions

File tree

openapidocs/mk/v3/views_mkdocs/partial/request-responses.html

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,14 @@
99
{%- with content = handler.simplify_content(definition.content) %}
1010
{% for content_type, definition in content.items() %}
1111
=== "{{content_type}}"
12-
{% include "partial/content-examples.html" %}
12+
{% for example in handler.get_content_examples(definition) %}
13+
{% if example.value %}
14+
```json
15+
{{handler.write_content_example(example, content_type) | indent(8) | safe}}
16+
```
17+
{% if example.auto_generated %}<span class="small-note">⚠️</span>&nbsp;<em class="small-note warning">{{texts.auto_generated_example_note}}</em>{% endif -%}
18+
{% endif %}
19+
{% endfor %}
1320
{% if "alt_types" in definition %}<em class="small-note alt-types">{{texts.other_possible_types}}: {{definition.alt_types | join(", ")}}</em>{% endif %}
1421

1522
??? hint "{{texts.schema_of_the_response_body}}"

0 commit comments

Comments
 (0)