Skip to content
Auto
Products

MarkdownText

Namespace: TagBites.Text.Markdown
Assembly: TagBites.Text.Markdown.dll
Product: TagBites.Text.Markdown v. 2.2.0

Carries a piece of content together with its Markdown form.

public struct MarkdownText : System.IEquatable<TagBites.Text.Markdown.MarkdownText>

A String converts implicitly and is escaped, so untrusted text cannot introduce markup. Use Raw(string) for content that is already Markdown. Escaping is minimal, because a character keeps its plain form where it carries no syntax.

Gets an instance without content.

public static MarkdownText Empty { get; }

MarkdownText

Gets a value indicating whether the instance carries no content.

public bool IsEmpty { get; }

bool

Gets a hard line break, written as two spaces and a new line.

public static MarkdownText LineBreak { get; }

MarkdownText

Gets the Markdown form, with syntax characters escaped unless the instance is raw.

public string Markdown { get; }

string

Gets the content without Markdown syntax, used by the clean text mode.

public string Text { get; }

string

Wraps the content in bold markers.

public static MarkdownText Bold(MarkdownText text)

MarkdownText

Wraps the content in a code span.

public static MarkdownText Code(string code)

MarkdownText

The delimiter outlasts the longest run of backticks in the content. A padding space keeps a backtick or a space at the edge inside the span.

Returns a value indicating whether both forms of other match this instance.

public virtual bool Equals(MarkdownText other)

bool

Returns a value indicating whether both forms of other match this instance.

public virtual bool Equals(object obj)

bool

Creates an instance from plain text, escaping the characters that carry syntax.

public static MarkdownText FromText(string text)

MarkdownText

public virtual int GetHashCode()

int

Builds an image held at address.

public static MarkdownText Image(MarkdownText name, string address)

MarkdownText

The display and the address are escaped if needed.

Builds an image held at address carrying title, which a renderer shows as a tooltip.

public static MarkdownText Image(MarkdownText name, string address, string title)

MarkdownText

The display and the address are escaped if needed.

Wraps the content in italic markers.

public static MarkdownText Italic(MarkdownText text)

MarkdownText

Builds a link to address.

public static MarkdownText Link(MarkdownText name, string address)

MarkdownText

The display and the address are escaped if needed.

Builds a link to address carrying title, which a renderer shows as a tooltip.

public static MarkdownText Link(MarkdownText name, string address, string title)

MarkdownText

The display and the address are escaped if needed.

Builds a link to target, using the text of the target as the display text.

public static MarkdownText Link(IMarkdownLinkTarget target)

MarkdownText

The address is IMarkdownLinkTarget.AnchorId with a leading #.

Builds a link to target with the given display text.

public static MarkdownText Link(MarkdownText name, IMarkdownLinkTarget target)

MarkdownText

The address is IMarkdownLinkTarget.AnchorId with a leading #.

Creates an instance from content that is already Markdown and must not be escaped.

public static MarkdownText Raw(string markdown)

MarkdownText

Creates an instance from content that is already Markdown, with the text the clean text mode returns.

public static MarkdownText Raw(string markdown, string text)

MarkdownText

Wraps the content in strikethrough markers, which the GitHub Flavored Markdown extension defines.

public static MarkdownText Strikethrough(MarkdownText text)

MarkdownText

public virtual string ToString()

string

Returns Markdown.

Joins two instances, keeping the escaping decision each of them was built with.

public static MarkdownText operator +(MarkdownText left, MarkdownText right)

MarkdownText

Returns a value indicating whether both forms of other match this instance.

public static bool operator ==(MarkdownText left, MarkdownText right)

bool

Converts plain text, escaping the characters that carry syntax.

public static implicit operator MarkdownText(string text)

MarkdownText

Returns a value indicating whether both forms of other match this instance.

public static bool operator !=(MarkdownText left, MarkdownText right)

bool