本文整理汇总了TypeScript中twitter-text.autoLinkUrlsCustom函数的典型用法代码示例。如果您正苦于以下问题:TypeScript autoLinkUrlsCustom函数的具体用法?TypeScript autoLinkUrlsCustom怎么用?TypeScript autoLinkUrlsCustom使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了autoLinkUrlsCustom函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: if
} else if (isMentionEntity(e)) {
console.log("screenName: ", e.screenName);
} else if (isCashtagEntity(e)) {
console.log("cashtag: ", e.cashtag);
} else {
console.error("Unreachable");
}
console.log(`indices: (${e.indices[0]}, ${e.indices[1]})`);
}
let result: string;
result = twitter.autoLink(text);
result = twitter.autoLinkUsernamesOrLists(text);
result = twitter.autoLinkHashtags(text);
result = twitter.autoLinkCashtags(text);
result = twitter.autoLinkUrlsCustom(text, {targetBlank: true, suppressNoFollow: true});
const len: number = twitter.getTweetLength(text);
const linked: string = twitter.autoLink("link @user, and expand url... http://t.co/0JG5Mcq", {
urlEntities: [
{
url: "http://t.co/0JG5Mcq",
display_url: "blog.twitter.com/2011/05/twitte…",
expanded_url: "http://blog.twitter.com/2011/05/twitter-for-mac-update.html",
indices: [
30,
48
]
}
]});
示例2: if
} else if (isMentionEntity(e)) {
console.log("screenName: ", e.screenName);
} else if (isCashtagEntity(e)) {
console.log("cashtag: ", e.cashtag);
} else {
console.error("Unreachable");
}
console.log(`indices: (${e.indices[0]}, ${e.indices[1]})`);
}
let result: string;
result = twitter.autoLink(text);
result = twitter.autoLinkUsernamesOrLists(text);
result = twitter.autoLinkHashtags(text);
result = twitter.autoLinkCashtags(text);
result = twitter.autoLinkUrlsCustom(text);
const len: number = twitter.getTweetLength(text);
const linked: string = twitter.autoLink("link @user, and expand url... http://t.co/0JG5Mcq", {
urlEntities: [
{
url: "http://t.co/0JG5Mcq",
display_url: "blog.twitter.com/2011/05/twitte…",
expanded_url: "http://blog.twitter.com/2011/05/twitter-for-mac-update.html",
indices: [
30,
48
]
}
]});
示例3: if
} else if (isMentionEntity(e)) {
console.log("screenName: ", e.screenName);
} else if (isCashtagEntity(e)) {
console.log("cashtag: ", e.cashtag);
} else {
console.error("Unreachable");
}
console.log(`indices: (${e.indices[0]}, ${e.indices[1]})`);
}
let result: string;
result = twitter.autoLink(text);
result = twitter.autoLinkUsernamesOrLists(text);
result = twitter.autoLinkHashtags(text);
result = twitter.autoLinkCashtags(text);
result = twitter.autoLinkUrlsCustom(text, {targetBlank: true, suppressNoFollow: true});
result = twitter.autoLinkUrlsCustom(text, {usernameIncludeSymbol: true, linkTextBlock: (entity, text) => {}});
const len: number = twitter.getTweetLength(text);
const linked: string = twitter.autoLink("link @user, and expand url... http://t.co/0JG5Mcq", {
urlEntities: [
{
url: "http://t.co/0JG5Mcq",
display_url: "blog.twitter.com/2011/05/twitte…",
expanded_url: "http://blog.twitter.com/2011/05/twitter-for-mac-update.html",
indices: [
30,
48
]
}