You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it("should NOT automatically link URLs within existing HTML tags",function(){
521
+
it("should NOT automatically link URLs within the attributes of existing HTML tags",function(){
522
522
varresult=autolinker.link('<p>Joe went to <a href="http://www.yahoo.com">yahoo</a></p>');
523
523
expect(result).toBe('<p>Joe went to <a href="http://www.yahoo.com">yahoo</a></p>');
524
524
});
525
525
526
+
527
+
it("should NOT automatically link URLs within the attributes of existing HTML tags when there are prefixed or suffixed spaces in the attribute values",function(){
528
+
varresult=autolinker.link('<p>Joe went to <a href=" http://www.yahoo.com">yahoo</a></p>');
529
+
expect(result).toBe('<p>Joe went to <a href=" http://www.yahoo.com">yahoo</a></p>');
530
+
531
+
varresult2=autolinker.link('<p>Joe went to <a href="http://www.yahoo.com ">yahoo</a></p>');
532
+
expect(result2).toBe('<p>Joe went to <a href="http://www.yahoo.com ">yahoo</a></p>');
533
+
});
534
+
535
+
536
+
it("should NOT automatically link URLs within self-closing tags",function(){
537
+
varresult=autolinker.link('Just a flower image <img src="https://farm9.staticflickr.com/8378/8578790632_83c6471f3f_b.jpg" />');
538
+
expect(result).toBe('Just a flower image <img src="https://farm9.staticflickr.com/8378/8578790632_83c6471f3f_b.jpg" />');
539
+
});
540
+
526
541
527
542
it("should NOT automatically link a URL found within the inner text of a pre-existing anchor tag",function(){
528
543
varresult=autolinker.link('<p>Joe went to <a href="http://www.yahoo.com">yahoo.com</a></p> yesterday.');
it("should NOT automatically link an image tag with a URL inside of it, when it has another attribute which has extraneous spaces surround its value (Issue #45)",function(){
it("should allow the full range of HTML attribute name characters as specified in the W3C HTML syntax document (http://www.w3.org/TR/html-markup/syntax.html)",function(){
552
573
// Note: We aren't actually expecting the HTML to be modified by this test
0 commit comments