Clean docstrings when generating actions docs

This commit is contained in:
Kovid Goyal 2021-06-30 15:06:12 +05:30
parent a8f7b1eb92
commit cf41d56c00
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -40,7 +40,7 @@ def is_action(x: object) -> bool:
return bool(doc and doc.strip().startswith('@ac:'))
def as_action(x: object) -> Action:
doc = (x.__doc__ or '').strip()
doc = inspect.cleandoc(x.__doc__ or '')
lines = doc.splitlines()
first = lines.pop(0)
parts = first.split(':', 2)