Skip to content

Commit c6f36c0

Browse files
committed
fix: Prevent whitespace removal before highlight filter
1 parent d3eee03 commit c6f36c0

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/mkdocstrings_handlers/python/templates/material/_base/attribute.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
{% if config.separate_signature %}
2626
<span class="doc doc-object-name doc-attribute-name">{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %}</span>
2727
{% else %}
28-
{% filter highlight(language="python", inline=True) %}
28+
{%+ filter highlight(language="python", inline=True) %}
2929
{% if show_full_path %}{{ attribute.path }}{% else %}{{ attribute.name }}{% endif %}
3030
{% if attribute.annotation %}: {{ attribute.annotation }}{% endif %}
3131
{% if attribute.value %} = {{ attribute.value }}{% endif %}

src/mkdocstrings_handlers/python/templates/material/_base/class.html

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@
2424
{% block heading scoped %}
2525
{% if config.separate_signature %}
2626
<span class="doc doc-object-name doc-class-name">{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}</span>
27-
{% elif config.merge_init_into_class and "__init__" in class.members -%}
28-
{%- with function = class.members["__init__"] -%}
29-
{%- filter highlight(language="python", inline=True) -%}
27+
{% elif config.merge_init_into_class and "__init__" in class.members %}
28+
{% with function = class.members["__init__"] %}
29+
{%+ filter highlight(language="python", inline=True) %}
3030
{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}
31-
{%- include "signature.html" with context -%}
32-
{%- endfilter -%}
33-
{%- endwith -%}
31+
{% include "signature.html" with context %}
32+
{% endfilter %}
33+
{% endwith %}
3434
{% else %}
3535
<code>{% if show_full_path %}{{ class.path }}{% else %}{{ class.name }}{% endif %}</code>
3636
{% endif %}

src/mkdocstrings_handlers/python/templates/material/_base/function.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{% if config.separate_signature %}
2828
<span class="doc doc-object-name doc-function-name">{% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}</span>
2929
{% else %}
30-
{% filter highlight(language="python", inline=True) %}
30+
{%+ filter highlight(language="python", inline=True) %}
3131
{% if show_full_path %}{{ function.path }}{% else %}{{ function.name }}{% endif %}
3232
{% include "signature.html" with context %}
3333
{% endfilter %}

0 commit comments

Comments
 (0)