[wp-trac] [WordPress Trac] #62530: Inline SVG Images Cannot Be Sized

WordPress Trac noreply at wordpress.org
Mon Nov 25 15:04:53 UTC 2024


#62530: Inline SVG Images Cannot Be Sized
--------------------------+------------------------------
 Reporter:  timsinclair   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  Media         |     Version:  6.7.1
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by timsinclair):

 This issue is with inline svg images, NOT the image block. I am adding svg
 upload capabilities via the upload_mimes filter, but I don't see why the
 src of the image tag would have any bearing on the application of an
 inline style attribute.

 Replying to [comment:2 yogeshbhutkar]:
 > Hi @timsinclair,
 >
 > Welcome to Trac, and thank you for raising the ticket.
 >
 > Could you kindly clarify how you are currently using SVGs as inline
 images? Natively, SVGs are not supported in image blocks. However, you can
 embed SVGs using the Custom HTML block, where you can directly set the
 width on the `<svg />` tag.
 >
 > Probably, in your case as well, you can try adding the width attribute
 within the SVG tag and see if that works.
 >
 > Please let me know if that works for your use case.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/62530#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list