Permalink
Browse files

Don't include symbolTag/textWithSymbolTag in html

  • Loading branch information...
1 parent d126c9f commit 9b8cdfeb2d214c71b63966e2438a74f62924efea @keitaf keitaf committed Jun 5, 2012
Showing with 3 additions and 1 deletion.
  1. +2 −0 test/tests.js
  2. +1 −1 twitter-text.js
View
@@ -100,7 +100,9 @@ test("twttr.txt.extract", function() {
test("twttr.txt.autolink", function() {
// Username Overrides
ok(twttr.txt.autoLink("@tw", { symbolTag: "s" }).match(/<s>@<\/s><a[^>]+>tw<\/a>/), "Apply symbolTag to @username");
+ ok(!twttr.txt.autoLink("@tw", { symbolTag: "s" }).match(/symbolTag/i), "Do not include symbolTag attribute");
ok(twttr.txt.autoLink("@tw", { textWithSymbolTag: "b" }).match(/@<a[^>]+><b>tw<\/b><\/a>/), "Apply textWithSymbolTag to @username");
+ ok(!twttr.txt.autoLink("@tw", { textWithSymbolTag: "b" }).match(/textWithSymbolTag/i), "Do not include textWithSymbolTag attribute");
ok(twttr.txt.autoLink("@tw", { symbolTag: "s", textWithSymbolTag: "b" }).match(/<s>@<\/s><a[^>]+><b>tw<\/b><\/a>/), "Apply symbolTag and textWithSymbolTag to @username");
same(twttr.txt.autoLink("@tw", { usernameIncludeSymbol: true }), "<a class=\"tweet-url username\" href=\"https://twitter.com/tw\" data-screen-name=\"tw\" rel=\"nofollow\">@tw</a>",
"Include @ in the autolinked username");
View
@@ -381,7 +381,7 @@ if (typeof twttr === "undefined" || twttr === null) {
'usernameUrlBase':true, 'listUrlBase':true, 'hashtagUrlBase':true, 'cashtagUrlBase':true,
'usernameUrlBlock':true, 'listUrlBlock':true, 'hashtagUrlBlock':true, 'linkUrlBlock':true,
'usernameIncludeSymbol':true, 'suppressLists':true, 'suppressNoFollow':true,
- 'suppressDataScreenName':true, 'urlEntities':true, 'before':true
+ 'suppressDataScreenName':true, 'urlEntities':true, 'symbolTag':true, 'textWithSymbolTag':true
};
var BOOLEAN_ATTRIBUTES = {'disabled':true, 'readonly':true, 'multiple':true, 'checked':true};

0 comments on commit 9b8cdfe

Please sign in to comment.