Skip to content

DOMpurify not suitable for case-sensitive SVG #144

@jampy

Description

@jampy

DOMpurify claims to be a sanitizer for SVG but unfortunately all tags are transformed to lower case.

After sanitizing, I get a document with all lowercase tags (unlike the original).

SVG tags are (unlike HTML) case-sensitive and some tags like feBlend, feGaussianBlur and all other filter tags contain uppercase letters. SVG parsers don't recognize tags like <fegaussianblur>, so this causes the SVG document to render incorrectly.

Can this behaviour please be made configurable?

BTW, it seems that the ADD_TAGS configuration expects lowercase names as well, or they won't be accepted.

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