mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix 'test_html_scaled_image_link' for Docutils' HEAD (#11863)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
parent
6083351320
commit
3b5d2afb9a
@ -8,6 +8,7 @@ from itertools import chain, cycle
|
||||
from pathlib import Path
|
||||
from unittest.mock import ANY, call, patch
|
||||
|
||||
import docutils
|
||||
import pytest
|
||||
from html5lib import HTMLParser
|
||||
|
||||
@ -1645,8 +1646,11 @@ def test_html_scaled_image_link(app):
|
||||
assert re.search('\n<img alt="_images/img.png" src="_images/img.png" />', context)
|
||||
|
||||
# scaled_image_link
|
||||
# Docutils 0.21 adds a newline before the closing </a> tag
|
||||
closing_space = "\n" if docutils.__version_info__[:2] >= (0, 21) else ""
|
||||
assert re.search('\n<a class="reference internal image-reference" href="_images/img.png">'
|
||||
'<img alt="_images/img.png" src="_images/img.png" style="[^"]+" /></a>',
|
||||
'<img alt="_images/img.png" src="_images/img.png" style="[^"]+" />'
|
||||
f'{closing_space}</a>',
|
||||
context)
|
||||
|
||||
# no-scaled-link class disables the feature
|
||||
|
Loading…
Reference in New Issue
Block a user