abeisgoat / Olly.js

Translate URLs into Rich Media
MIT License
435 stars 31 forks source link

Error due to olly.richify.URLs being null when there are no URLs to embed #15

Closed CrocoDroid closed 9 years ago

CrocoDroid commented 10 years ago

This gives a "Cannot read property 'length' of null" error:

for (var urlIndex=0; urlIndex<URLs.length; urlIndex++) {
                    var url = URLs[urlIndex];
                    for (otbIndex=0; otbIndex<OTBs.length; otbIndex++) {
                        OTB = OTBs[otbIndex];
                        nOTBs.push(OTB.replace(url, "<span class='olly'>" + url + "</span>"));
                    }   
                }

when we use

olly.richify("just text, no embeddable content", document.getElementById("blob"));
abeisgoat commented 10 years ago

Thanks.

That whole OTB/nOTB section is hella confusing. Gonna refactor it fix this for 1.1

abeisgoat commented 9 years ago

The richify method is really bad and needs a complete test suite, so I've removed it from Olly until further testing can be done.