Skip to content

Commit

Permalink
HTML: add tests for SVG width and height options
Browse files Browse the repository at this point in the history
  • Loading branch information
tuncbkose committed Jun 12, 2024
1 parent 85a2e1e commit d78248f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/roots/test-root/images.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,13 @@ Sphinx image handling
.. an SVG image (for HTML at least)
.. image:: svgimg.*

.. an SVG image using width with units
.. image:: svgimg.*
:width: 2cm

.. an SVG image using width with units
.. image:: svgimg.*
:height: 2cm

.. an image with more than 1 dot in its file name
.. image:: img.foo.png
3 changes: 3 additions & 0 deletions tests/test_builders/test_build_html_5_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def checker(nodes):
('images.html', ".//img[@src='_images/simg.png']", ''),
('images.html', ".//img[@src='_images/svgimg.svg']", ''),
('images.html', ".//a[@href='_sources/images.txt']", ''),
# Check svg options
('images.html', ".//img[@src='_images/svgimg.svg'][@style='width: 2cm;']", ''),
('images.html', ".//img[@src='_images/svgimg.svg'][@style='height: 2cm;']", ''),
('subdir/images.html', ".//img[@src='../_images/img1.png']", ''),
('subdir/images.html', ".//img[@src='../_images/rimg.png']", ''),
Expand Down

0 comments on commit d78248f

Please sign in to comment.