mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Trim leading whitespace before doctest flags (#13164)
This commit is contained in:
parent
432bc5e50b
commit
ad0c343d36
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user