Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
pass options from linkToUrl() to linkTextWithEntity()
Browse files Browse the repository at this point in the history
  • Loading branch information
keita committed May 2, 2012
1 parent c9946a6 commit c6db895
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions twitter-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ if (typeof twttr === "undefined" || twttr === null) {
if (!options.title) {
options.htmlAttrs = (options.htmlAttrs || "") + " title=\"" + urlEntity.expanded_url + "\"";
}
linkText = twttr.txt.linkTextWithEntity(urlEntity);
linkText = twttr.txt.linkTextWithEntity(urlEntity, options);
}

var d = {
Expand All @@ -461,7 +461,7 @@ if (typeof twttr === "undefined" || twttr === null) {
return stringSupplant("<a href=\"#{url}\"#{htmlAttrs}>#{linkText}</a>", d);
};

twttr.txt.linkTextWithEntity = function (entity) {
twttr.txt.linkTextWithEntity = function (entity, options) {
var displayUrl = entity.display_url;
var expandedUrl = entity.expanded_url;

Expand Down Expand Up @@ -522,7 +522,7 @@ if (typeof twttr === "undefined" || twttr === null) {
// <span style='font-size:0'>&nbsp;</span>
// …
// </span>
v['invisible'] = "style='font-size:0; line-height:0'";
v['invisible'] = options.invisibleTagAttrs;
return stringSupplant("<span class='tco-ellipsis'>#{precedingEllipsis}<span #{invisible}>&nbsp;</span></span><span #{invisible}>#{beforeDisplayUrl}</span><span class='js-display-url'>#{displayUrlSansEllipses}</span><span #{invisible}>#{afterDisplayUrl}</span><span class='tco-ellipsis'><span #{invisible}>&nbsp;</span>#{followingEllipsis}</span>", v);
}
return displayUrl;
Expand Down

0 comments on commit c6db895

Please sign in to comment.