Skip to content

Feature request: strip inside of SVG elements #23

@jducrot

Description

@jducrot

Most of the time, SVG elements are used for icons in an interactive element such as a button or a link. Just like the ability to strip empty tags, it would be nice to have a way to strip SVGs to their barebone structure (i.e. just the svg element itself, none of its innards). Take the following example as currently stripped by your tool:
<a href="…" rel="home"><svg id="wh-oval-nofill-917" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 343 243" xml:space="preserve"><style type="text/css">...</style><g></g></svg></a>

Having an option to reduce it to this barebone content would be handy:
<a href="…" rel="home"> <svg>...</svg> </a>

In this case I wanted to point out that the link lacked an accessible name and I wanted to quickly show how to plug in a visually hidden span inside of the link right before the svg.

Keep up the good work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions