Skip to content

Commit 08b2d47

Browse files
Remove wordwrap filters from all templates (issue #47) (#69)
wordwrap breaks long URLs and mermaid superfences code blocks inside operation/info/response descriptions. Removed from all mkdocs and markdown partial templates. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent b413b1b commit 08b2d47

File tree

13 files changed

+54
-91
lines changed

13 files changed

+54
-91
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1515
never supported as there was never a `/mk/v2/` namespace, intentionally).
1616
- Fix [#35](https://github.com/Neoteroi/essentials-openapi/issues/35): group response
1717
codes in a tab group on MkDocs output, reported by @Andre601.
18+
- Fix [#47](https://github.com/Neoteroi/essentials-openapi/issues/47): remove `wordwrap`
19+
filters from all templates as they break links and mermaid chart code blocks in
20+
descriptions, reported by @ElementalWarrior.
1821

1922
## [1.3.0] - 2025-11-19
2023

openapidocs/mk/v3/views_markdown/partial/components-responses.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{%- for name, definition in components.responses.items() %}
55

66
### {{name}}
7-
{% if definition.description %}{{definition.description | wordwrap(80)}}{% endif -%}
7+
{% if definition.description %}{{definition.description}}{% endif -%}
88

99
{%- if definition.content -%}
1010
{% with content = handler.simplify_content(definition.content) -%}

openapidocs/mk/v3/views_markdown/partial/content-examples.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
```json
44
{{handler.write_content_example(example, content_type) | safe}}
55
```
6-
{% if example.auto_generated %}_{{texts.auto_generated_example_note | wordwrap(80)}}_{% endif -%}
6+
{% if example.auto_generated %}_{{texts.auto_generated_example_note}}_{% endif -%}
77
{% endif %}
88
{% endfor %}

openapidocs/mk/v3/views_markdown/partial/external-docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## {{texts.external_docs}}
22

33
{% if externalDocs.description -%}
4-
{{externalDocs.description | wordwrap(80)}}
4+
{{externalDocs.description}}
55

66
---
77
{% endif -%}

openapidocs/mk/v3/views_markdown/partial/info.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# {{info.title}} {{info.version}}
22

33
{% if info.description -%}
4-
{{info.description | wordwrap(80)}}
4+
{{info.description}}
55

66
---
77
{% endif -%}

openapidocs/mk/v3/views_markdown/partial/path-items.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
### {{http_method.upper()}} {{path | safe}}
99
{% if "summary" in operation -%}
10-
{{operation.summary | wordwrap(80)}}
10+
{{operation.summary}}
1111
{%- endif -%}
1212

1313
{%- if operation.description and operation.summary != operation.description %}
1414

1515
**{{texts.description.title()}}**
16-
{{operation.description | wordwrap(80)}}
16+
{{operation.description}}
1717

1818
{%- endif -%}
1919

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{% for name, definition in components.responses.items() %}
66

77
### {{name}}
8-
{% if definition.description %}{{definition.description | wordwrap(80)}}{% endif %}
8+
{% if definition.description %}{{definition.description}}{% endif %}
99

1010
{%- if definition.content %}
1111
{% with content = handler.simplify_content(definition.content) %}

openapidocs/mk/v3/views_mkdocs/partial/external-docs.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
## {{texts.external_docs}}
22

33
{% if externalDocs.description -%}
4-
{{externalDocs.description | wordwrap(80)}}
4+
{{externalDocs.description}}
55

66
<hr />
77
{%- endif -%}

openapidocs/mk/v3/views_mkdocs/partial/info.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# {{info.title}} <span class="api-version">{{info.version}}</span>
22

33
{% if info.description -%}
4-
{{info.description | wordwrap(80)}}
4+
{{info.description}}
55
<hr />
66
{%- endif -%}
77

openapidocs/mk/v3/views_mkdocs/partial/path-items.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77

88
### <span class="http-{{http_method.lower()}}">{{http_method.upper()}}</span> {{path | route | safe}}
99
{% if "summary" in operation -%}
10-
{{operation.summary | wordwrap(80)}}
10+
{{operation.summary}}
1111
{%- endif -%}
1212

1313
{%- if operation.description and operation.summary != operation.description %}
1414

1515
??? note "{{texts.description.title()}}"
16-
{{operation.description | wordwrap(76) | indent(4)}}
16+
{{operation.description | indent(4)}}
1717
{% endif %}
1818

1919
{%- with parameters = handler.get_parameters(operation) -%}

0 commit comments

Comments
 (0)