Closed Cogito closed 9 years ago
It's worth noting that the situation I am running into occurs when something like google.com" is escaped to google.com"
This is then turned into google.com";
Note the trailing semicolon
+1 I ran into this same issue yesterday, except with " around the URL instead of "
Thanks for the report, will look into it
Quick failing test I whipped up....
it( "should handle a URL inside an HTML-encoded anchor tag", function() {
var html = "Joe learned about anchor tags on the <a href="http://www.w3schools.com/aaa">W3SCHOOLS</a> site ...";
var tobe = "Joe learned about anchor tags on the <a href="<a href=\"http://www.w3schools.com/aaa\">w3schools.com</a>">W3SCHOOLS</a> site ...";
var result = autolinker.link( html );
expect( result ).toBe( tobe );
});
+1
Could possibly be solved by adding "
to the htmlCharacterEntitiesRegex
? I did this as a temporary workaround and it seems to work:
var autolinker = new Autolinker();
autolinker.htmlCharacterEntitiesRegex = /( | |<|<|>|>|"|"|')/gi;
This adds the regex for both " and '.
Fixed in 0.15.2
"google.com&" should parse to "google.com&" but is instead parsed to "google.com&"
"google.com&" is not a valid URL