Normalize <img> tags to use width/height attributes.

Review Request #13345 — Created Oct. 15, 2023 and submitted

Information

beanbag-docutils
master

Reviewers

Sphinx turns image widths/heights into style attributes, which isn't
ideal. Browsers make use of the width/height attributes to help with
initial page layout and to calculate aspect ratios, and Sphinx takes
this away from us. These are not deprecated attributes, and not strictly
interchangeable with the CSS styles.

The image_srcsets extension will now restore these attributes and
remove the CSS styles.

All unit tests pass.

Summary ID
Normalize <img> tags to use width/height attributes.
Sphinx turns image widths/heights into `style` attributes, which isn't ideal. Browsers make use of the `width`/`height` attributes to help with initial page layout and to calculate aspect ratios, and Sphinx takes this away from us. These are not deprecated attributes, and not strictly interchangeable with the CSS styles. The `image_srcsets` extension will now restore these attributes and remove the CSS styles.
4a170bca9b8acc40a05bd61cee93733f2c18a08e
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (fb82dc3)