From 7ed724b992bbd0fe15427b9e4196d0d63affefb8 Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Thu, 5 Dec 2024 00:27:09 +0100 Subject: [PATCH] Trim leading spaces along doctest flags --- sphinx/ext/doctest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py index 6c0327fab02..8b55e1bef88 100644 --- a/sphinx/ext/doctest.py +++ b/sphinx/ext/doctest.py @@ -38,7 +38,7 @@ logger = logging.getLogger(__name__) blankline_re = re.compile(r'^\s*', re.MULTILINE) -doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE) +doctestopt_re = re.compile(r' *#\s*doctest:.+$', re.MULTILINE) def is_allowed_version(spec: str, version: str) -> bool: