Skip to content

Commit 1a6809c

Browse files
committed
fix: Dedent attributes docstrings
References: #42
1 parent 1af9a53 commit 1a6809c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: src/pytkdocs/parsers/attributes.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def get_pairs(nodes):
8080
def get_module_or_class_attributes(nodes):
8181
result = {}
8282
for assignment, string_node in get_pairs(nodes):
83-
string = string_node.s if string_node else None
83+
string = dedent(string_node.s) if string_node else None
8484
if isinstance(assignment, ast.Assign):
8585
names = [target.id for target in assignment.targets]
8686
else:
@@ -151,7 +151,7 @@ def get_instance_attributes(func):
151151
if not names or (string is None and annotation is None):
152152
continue
153153

154-
docstring = string.s if string else None
154+
docstring = dedent(string.s) if string else None
155155
for name in names:
156156
result[name] = {"annotation": annotation, "docstring": docstring}
157157

0 commit comments

Comments
 (0)