Skip to content

Sanitizer removes "title" elements from SVG #1267

@brianquinlan

Description

@brianquinlan

Here is an example:
https://raw.githubusercontent.com/google/pybadges/master/tests/golden-images/build-failure.svg?sanitize=true

The original image has content like:

<svg height="20" width="82.30000000000001" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Error in foo.py, line 3</title>
<linearGradient...

The sanitized version:

+ <?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="20" width="82.30000000000001">
- <title>Error in foo.py, line 3</title>
<linearGradient...

I think that title elements should be safe and can be whitelisted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions