github/markup

Sanitizer removes "title" elements from SVG

brianquinlan opened this issue · 1 comments

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.

👋 Please reach out to our support team with your bug report — this repository is only monitored by maintainers of the gem. Thanks!