jlmakes / scrollreveal

Animate elements as they scroll into view.

Home Page:https://scrollrevealjs.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

URL in background images broken when splitting inline styles

gildersleeve opened this issue · comments

var ref = pair.split(':').map(function (s) { return s.trim(); });

If an inline style includes an absolute path to an image it will be split incorrectly here. The split assumes there is only 1 : but background images can introduce multiple :.

Example: <div style="background-image:url('https://www.example.com/test.jpg')"></div>. It would be incorrect to split on :.

Since the next line looks for the value as ref[1], what gets rendered here after running through scroll magic is <div style="background-image:url('https')"></div>

commented

Thanks for catching this @gildersleeve!!