Skip to content

Inline SVG without optional x, y or viewBox attribute #41

@stonio

Description

@stonio

Let's consider a SVG image without x, y or viewBox attributes defined in svg element.

If we inline this image included in a HTML document, these 3 parameters are forcibly inserted in output.
Can we omit these optional attributes if not set?

Example

Content of foo.svg

<?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve"><circle r="999"/></svg>

Actual result

<svg x="0" y="0" viewBox="0 0 100 100" id="Layer_1" xml:space="preserve"><circle r="999"/></svg>

Expected result

<svg id="Layer_1" xml:space="preserve"><circle r="999"/></svg>

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