FIX: Don't onebox links with labels unless the labels are the same as the URL

This commit is contained in:
Robin Ward
2013-09-06 16:46:55 -04:00
parent c996378fc0
commit a9f3489237
3 changed files with 13 additions and 0 deletions

View File

@ -217,6 +217,11 @@ test("Oneboxing", function() {
ok(matches("http://test.com\nhttp://test2.com", /onebox[\s\S]+onebox/m), "supports multiple links");
ok(!matches("http://test.com bob", /onebox/), "doesn't onebox links that have trailing text");
ok(!matches("[Tom Cruise](http://www.tomcruise.com/)", "onebox"), "Markdown links with labels are not oneboxed");
ok(matches("[http://www.tomcruise.com/](http://www.tomcruise.com/)",
"onebox"),
"Markdown links where the label is the same as the url are oneboxed");
cooked("http://en.wikipedia.org/wiki/Homicide:_Life_on_the_Street",
"<p><a href=\"http://en.wikipedia.org/wiki/Homicide:_Life_on_the_Street\" class=\"onebox\"" +
">http://en.wikipedia.org/wiki/Homicide:_Life_on_the_Street</a></p>",