diff --git a/sphinx_click/ext.py b/sphinx_click/ext.py index 4441588..b6bf205 100644 --- a/sphinx_click/ext.py +++ b/sphinx_click/ext.py @@ -1,3 +1,4 @@ +import inspect import re import traceback import warnings @@ -101,7 +102,7 @@ def _write_opts(opts): def _format_help(help_string): - help_string = ANSI_ESC_SEQ_RE.sub('', help_string) + help_string = inspect.cleandoc(ANSI_ESC_SEQ_RE.sub('', help_string)) bar_enabled = False for line in statemachine.string2lines( diff --git a/tests/test_formatter.py b/tests/test_formatter.py index 0cc8651..07b7230 100644 --- a/tests/test_formatter.py +++ b/tests/test_formatter.py @@ -377,7 +377,6 @@ def foobar(): foobar [OPTIONS] - An epilog containing pre-wrapped text. | This is