diff options
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/directives/code.py | 2 |
2 files changed, 2 insertions, 1 deletions
@@ -23,6 +23,7 @@ Bugs fixed * #9644: autodoc: Crashed on getting source info from problematic object * #9630: autosummary: Failed to build summary table if :confval:`primary_domain` is not 'py' +* #9636: code-block: ``:dedent:`` handled numeric argument ``0`` like no argument was given Testing -------- diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 12ab51c58..5859f359a 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -57,7 +57,7 @@ class Highlight(SphinxDirective): def dedent_lines(lines: List[str], dedent: int, location: Tuple[str, int] = None) -> List[str]: - if not dedent: + if dedent is None: return textwrap.dedent(''.join(lines)).splitlines(True) if any(s[:dedent].strip() for s in lines): |