From 3b5d2afb9a20f1bfa9a6828209fc10151905cea3 Mon Sep 17 00:00:00 2001
From: James Addison <55152140+jayaddison@users.noreply.github.com>
Date: Wed, 10 Jan 2024 01:01:47 +0000
Subject: [PATCH] Fix 'test_html_scaled_image_link' for Docutils' HEAD (#11863)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
---
tests/test_build_html.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test_build_html.py b/tests/test_build_html.py
index a89a6fcaf..5707d38b2 100644
--- a/tests/test_build_html.py
+++ b/tests/test_build_html.py
@@ -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
', context)
# scaled_image_link
+ # Docutils 0.21 adds a newline before the closing tag
+ closing_space = "\n" if docutils.__version_info__[:2] >= (0, 21) else ""
assert re.search('\n'
- '
',
+ '
'
+ f'{closing_space}',
context)
# no-scaled-link class disables the feature