File tree 2 files changed +13
-1
lines changed
src/mkdocstrings_handlers/python/templates/material/_base 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change 38
38
{%- endif -%}
39
39
{%- endfor -%}
40
40
)
41
- {%- if config.show_signature_annotations and function.annotation %} -> {{ function.annotation }}{%- endif -%}
41
+ {%- if config.show_signature_annotations and function.annotation %} -> {{ function.annotation|safe }}{%- endif -%}
42
42
43
43
{%- endwith -%}
44
44
{%- endif -%}
Original file line number Diff line number Diff line change @@ -31,3 +31,15 @@ def test_render_docstring_examples_section(renderer):
31
31
assert "<p>This is an example.</p>" in rendered
32
32
assert "print" in rendered
33
33
assert "Hello" in rendered
34
+
35
+
36
+ def test_format_code_and_signature (renderer ):
37
+ """Assert code and signatures can be Black-formatted.
38
+
39
+ Parameters:
40
+ renderer: A renderer instance (parametrized).
41
+ """
42
+ assert renderer .do_format_code ("print('Hello')" , 100 )
43
+ assert renderer .do_format_code ('print("Hello")' , 100 )
44
+ assert renderer .do_format_signature ("(param: str = 'hello') -> 'Class'" , 100 )
45
+ assert renderer .do_format_signature ('(param: str = "hello") -> "Class"' , 100 )
You can’t perform that action at this time.
0 commit comments