Skip to content

Commit

Permalink
Trim leading whitespace characters along doctest flags
Browse files Browse the repository at this point in the history
  • Loading branch information
m-aciek committed Dec 4, 2024
1 parent df3d94f commit 8ba1171
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sphinx/ext/doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
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'\s*#\s*doctest:.+$', re.MULTILINE)


def is_allowed_version(spec: str, version: str) -> bool:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ 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


@pytest.mark.sphinx(
Expand Down

0 comments on commit 8ba1171

Please sign in to comment.