Autolink Class

Namespace:
Weavy.Core.TwitterText
Assembly:
Weavy.Core.dll

A class for adding HTML links to hashtag, username and list references in Tweet text.

public class Autolink
Inheritance:
System.Object → Autolink

Constructors

Autolink() Initializes a new instance of the Autolink class.
Autolink(Extractor) Initializes a new instance of the Autolink class using the specified Extractor.

Fields

DEFAULT_CASHTAG_CLASS Default CSS class for auto-linked cashtag URLs
DEFAULT_CASHTAG_URL_BASE Default href for cashtag links (the cashtag without the $ will be appended)
DEFAULT_HASHTAG_CLASS Default CSS class for auto-linked hashtag URLs
DEFAULT_HASHTAG_URL_BASE Default href for hashtag links (the hashtag without the # will be appended)
DEFAULT_INVISIBLE_TAG_ATTRS Default attribute for invisible span tag
DEFAULT_LIST_URL_BASE Default href for list links (the username/list without the @ will be appended)
DEFAULT_USERNAME_CLASS Default CSS class for auto-linked username URLs
DEFAULT_USERNAME_URL_BASE Default href for username links (the username without the @ will be appended)

Properties

CashtagClass Gets or sets the CSS class for auto-linked cashtag URLs,
CashtagUrlBase Gets or sets the href value for cashtag links (to which the cashtag will be appended).
ExtractMarkdownUrl Indicates whether URLs without protocol should be extracted.
ExtractMentionedEntity Indicates whether mentioned user/space should be extacted with id.
ExtractURLWithoutProtocol Indicates whether URLs without protocol should be extracted.
ExtractURLWithoutTopDomain Indicates whether URLs without top level domain (intranet urls) should be extracted.
HashtagClass Gets or sets the CSS class for auto-linked hashtag URLs.
HashtagUrlBase Gets or sets the href value for hashtag links (to which the hashtag will be appended).
InvisibleTagAttrs
LinkAttributeModifier Sets a modifier to modify attributes of a link based on an entity.
LinkTextModifier Sets a modifier to modify text of a link based on an entity.
ListUrlBase Gets or sets the href value for list links (to which the username/list will be appended).
NoFollow Gets or sets a value indicating if the current URL links will include rel="nofollow" (true by default).
OpenExternalLinksInNewWindow Sets whether external links should be opened in a new window/tab
SymbolTag Sets HTML tag to be applied around #/@/# symbols in hashtags/usernames/lists/cashtag. The tag should be without brackets e.g., "b" or "s".
TextWithSymbolTag Set HTML tag to be applied around text part of hashtags/usernames/lists/cashtag. The tag should be without brackets e.g., "b" or "s".
UrlClass Gets or set the CSS class for auto-linked URLs.
UrlTarget Sets the value of the target attribute in auto-linked URLs e.g., "_blank"
UsernameClass Gets or set the CSS class for auto-linked username URLs.
UsernameIncludeSymbol Sets a value indicating whether the at mark '@' should be included in the link (false by default).
UsernameUrlBase Gets or sets the href value for username links (to which the username will be appended).

Methods

AutoLink(string) Auto-link mentions, hashtags, cashtags and urls.
AutoLinkCashtags(string) Auto-link $cashtag references in the provided Tweet text. The $cashtag links will have the cashtagClass CSS class added.
AutoLinkHashtags(string) Auto-link #hashtag references in the provided Tweet text. The #hashtag links will have the hashtagClass CSS class added.
AutoLinkMentions(string) Auto-link the @username references in the provided text. Links to @username references will have the usernameClass CSS classes added.
AutoLinkTokens(string, List)
AutoLinkUrls(string) Auto-link URLs in the Tweet text provided. This only auto-links URLs with protocol.
EscapeBrackets(string)
LinkToCashtag(Token, string, StringBuilder)
LinkToHashtag(Token, string, StringBuilder)
LinkToMention(Token, string, StringBuilder)
LinkToText(Token, string, IDictionary, StringBuilder)
LinkToTextWithSymbol(Token, string, string, IDictionary, StringBuilder)
LinkToUrl(Token, string, StringBuilder)

Extension Methods

IsNullOrDefault(T) Gets a value indicating if the specified value has the default value of the generic type.
Serialize(object) Serializes an object, or graph of connected objects, to a byte array.
SerializeToJson(object, Formatting?, JsonSerializerSettings) Serializes an object, or graph of connected objects, to a json string.
IsValid(object) Determines whether the specified object is valid by evaluating each ValidationAttribute instance that is attached to the object type.