Skip to content

Commit efef056

Browse files
committed
Add support for click 8.1.x
click 8.1.0 changed the behavior of the various stored help strings: Store unprocessed Command.help, epilog and short_help strings. Processing is only done when formatting help text for output. [1] https://click.palletsprojects.com/en/8.1.x/changes/#version-8-1-0 Signed-off-by: Stephen Finucane <stephen@that.guru>
1 parent 431f159 commit efef056

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

sphinx_click/ext.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import inspect
12
import re
23
import traceback
34
import warnings
@@ -101,7 +102,7 @@ def _write_opts(opts):
101102

102103

103104
def _format_help(help_string):
104-
help_string = ANSI_ESC_SEQ_RE.sub('', help_string)
105+
help_string = inspect.cleandoc(ANSI_ESC_SEQ_RE.sub('', help_string))
105106

106107
bar_enabled = False
107108
for line in statemachine.string2lines(

tests/test_formatter.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,6 @@ def foobar():
377377
378378
foobar [OPTIONS]
379379
380-
381380
An epilog containing pre-wrapped text.
382381
383382
| This is

0 commit comments

Comments
 (0)