Trim leading whitespace before doctest flags (#13164)

This commit is contained in:
Maciej Olko authored and GitHub committed 2025-01-04 00:30:03 +00:00
1 parent 432bc5e50b
commit ad0c343d36
2 files changed
+3 -1

No files matched your search

+1 -1
View File
@@ -38,7 +38,7 @@ if TYPE_CHECKING:
logger = logging.getLogger(__name__)
blankline_re = re.compile(r'^\s*<BLANKLINE>', re.MULTILINE)
doctestopt_re = re.compile(r'#\s*doctest:.+$', re.MULTILINE)
doctestopt_re = re.compile(r'[ \t]*#\s*doctest:.+$', re.MULTILINE)
def is_allowed_version(spec: str, version: str) -> bool:
@@ -15,6 +15,8 @@ def test_trim_doctest_flags_html(app):
assert 'QUUX' not in result
assert 'CORGE' not in result
assert 'GRAULT' in result
assert '<span class="n">now</span><span class="p">()</span> \n' not in result
assert '<span class="n">now</span><span class="p">()</span>\n' in result
@pytest.mark.sphinx(