Closed mjr9804 closed 4 years ago
Thank you for the PR! I will try to take a look at the weekend
I ran into one issue with this change. Since the title is set when the SVG is downloaded, you can't use the same image in 2 places with different titles. The first title that is set will always be used since the image is (nicely) only downloaded once and then cached.
I'll look at moving the setTitle
to a more appropriate place when I have some free time.
Updated with a better diff that sets the title each time the image is used (not just when the SVG is downloaded)
Nice! I hope I will have some free time this week to review and publish it.
Adds a
title
prop to allow setting the content of the SVG's<title>
element. If the SVG already has a title, it will be overwritten with the value of the prop. Otherwise, a<title>
is created and appended to the SVG.Fixes #3