Skip to content

Commit a057cfc

Browse files
authored
Merge pull request #3 from Chilipp/sig-fix
Fixed escape of * in summary table
2 parents ab289a9 + 779a79f commit a057cfc

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

autodocsumm/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ def get_items_from_documenters(self, documenters):
611611
else:
612612
max_chars = max(10, max_item_chars - len(display_name))
613613
sig = mangle_signature(sig, max_chars=max_chars)
614-
sig = sig.replace('*', r'\*')
614+
# sig = sig.replace('*', r'\*')
615615

616616
# -- Grab the documentation
617617

tests/sphinx_supp/dummy.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ def test_method(self):
4646
"""Test if the method is included"""
4747
pass
4848

49+
def test_method_args_kwargs(self, *args, **kwargs):
50+
"""The stars at args and kwargs should not be escaped"""
51+
4952
#: to test if the class attribute is included
5053
test_attr = None
5154

tests/test_autodocsumm.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ def test_class(self, app, status, warning):
8282
self.assertIn('<span class="pre">test_method</span>', html)
8383
self.assertIn('<span class="pre">test_attr</span>', html)
8484

85+
# test escaping of *
86+
self.assertNotIn(r'\*args', html)
87+
self.assertNotIn(r', \*\*kwargs', html)
88+
self.assertIn('*args', html)
89+
self.assertIn('**kwargs', html)
90+
8591
# test whether the right objects are included
8692
self.assertIn('<span class="pre">class_caller</span>', html)
8793
self.assertIn('Caller docstring for class attribute', html)

0 commit comments

Comments
 (0)