flobacher / SVGInjector2

Fast, caching, dynamic inline SVG DOM injection library
MIT License
57 stars 8 forks source link

Be consistent on usage of IMG / SVG #12

Closed Viveur closed 7 years ago

Viveur commented 7 years ago

Noticed some inconsistencies over the use of IMG & SVG in the README documentation that might be confusing for some users:

Wrangling and maintaining a bunch of inline SVG on your pages isn't anyone's idea of good time, so SVGInjector lets you work with simple img tag elements (or other tag of your choosing) and does the heavy lifting of swapping in the SVG markup inline for you.

& then further down:

Add some SVG svg tags.

<svg class="inject-me" src="image-one.svg"> <svg class="inject-me" src="image-two.svg"> Inject 'em.

var mySVGsToInject = document.querySelectorAll('img.inject-me');

The svg tags have now been replaced with the full SVG markup.

flobacher commented 7 years ago

@TheCopartnery I just pushed a new commit to resolve this. Please check.

Viveur commented 7 years ago

Cheers. Have added some additional changes that should help clarify behaviour, along with an updated example showing alternative uses.