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>Remarks
Section titled “Remarks”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.
Properties
Section titled “Properties”Gets an instance without content.
public static MarkdownText Empty { get; }Property Value
Section titled “Property Value”IsEmpty
Section titled “IsEmpty”Gets a value indicating whether the instance carries no content.
public bool IsEmpty { get; }Property Value
Section titled “Property Value”LineBreak
Section titled “LineBreak”Gets a hard line break, written as two spaces and a new line.
public static MarkdownText LineBreak { get; }Property Value
Section titled “Property Value”Markdown
Section titled “Markdown”Gets the Markdown form, with syntax characters escaped unless the instance is raw.
public string Markdown { get; }Property Value
Section titled “Property Value”Gets the content without Markdown syntax, used by the clean text mode.
public string Text { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”Bold(MarkdownText)
Section titled “Bold(MarkdownText)”Wraps the content in bold markers.
public static MarkdownText Bold(MarkdownText text)Parameters
Section titled “Parameters”textMarkdownText
Returns
Section titled “Returns”Code(string)
Section titled “Code(string)”Wraps the content in a code span.
public static MarkdownText Code(string code)Parameters
Section titled “Parameters”codestring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”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.
Equals(MarkdownText)
Section titled “Equals(MarkdownText)”Returns a value indicating whether both forms of other match this instance.
public virtual bool Equals(MarkdownText other)Parameters
Section titled “Parameters”otherMarkdownText
Returns
Section titled “Returns”Equals(object)
Section titled “Equals(object)”Returns a value indicating whether both forms of other match this instance.
public virtual bool Equals(object obj)Parameters
Section titled “Parameters”objobject
Returns
Section titled “Returns”FromText(string)
Section titled “FromText(string)”Creates an instance from plain text, escaping the characters that carry syntax.
public static MarkdownText FromText(string text)Parameters
Section titled “Parameters”textstring
Returns
Section titled “Returns”GetHashCode()
Section titled “GetHashCode()”public virtual int GetHashCode()Returns
Section titled “Returns”Image(MarkdownText, string)
Section titled “Image(MarkdownText, string)”Builds an image held at address.
public static MarkdownText Image(MarkdownText name, string address)Parameters
Section titled “Parameters”nameMarkdownTextaddressstring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”The display and the address are escaped if needed.
Image(MarkdownText, string, string)
Section titled “Image(MarkdownText, string, string)”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)Parameters
Section titled “Parameters”nameMarkdownTextaddressstringtitlestring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”The display and the address are escaped if needed.
Italic(MarkdownText)
Section titled “Italic(MarkdownText)”Wraps the content in italic markers.
public static MarkdownText Italic(MarkdownText text)Parameters
Section titled “Parameters”textMarkdownText
Returns
Section titled “Returns”Link(MarkdownText, string)
Section titled “Link(MarkdownText, string)”Builds a link to address.
public static MarkdownText Link(MarkdownText name, string address)Parameters
Section titled “Parameters”nameMarkdownTextaddressstring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”The display and the address are escaped if needed.
Link(MarkdownText, string, string)
Section titled “Link(MarkdownText, string, string)”Builds a link to address carrying title, which a renderer shows as a tooltip.
public static MarkdownText Link(MarkdownText name, string address, string title)Parameters
Section titled “Parameters”nameMarkdownTextaddressstringtitlestring
Returns
Section titled “Returns”Remarks
Section titled “Remarks”The display and the address are escaped if needed.
Link(IMarkdownLinkTarget)
Section titled “Link(IMarkdownLinkTarget)”Builds a link to target, using the text of the target as the display text.
public static MarkdownText Link(IMarkdownLinkTarget target)Parameters
Section titled “Parameters”targetIMarkdownLinkTarget
Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”- ArgumentException - The target carries no anchor.
Remarks
Section titled “Remarks”The address is IMarkdownLinkTarget.AnchorId with a leading #.
Link(MarkdownText, IMarkdownLinkTarget)
Section titled “Link(MarkdownText, IMarkdownLinkTarget)”Builds a link to target with the given display text.
public static MarkdownText Link(MarkdownText name, IMarkdownLinkTarget target)Parameters
Section titled “Parameters”nameMarkdownTexttargetIMarkdownLinkTarget
Returns
Section titled “Returns”Exceptions
Section titled “Exceptions”- ArgumentException - The target carries no anchor.
Remarks
Section titled “Remarks”The address is IMarkdownLinkTarget.AnchorId with a leading #.
Raw(string)
Section titled “Raw(string)”Creates an instance from content that is already Markdown and must not be escaped.
public static MarkdownText Raw(string markdown)Parameters
Section titled “Parameters”markdownstring
Returns
Section titled “Returns”Raw(string, string)
Section titled “Raw(string, string)”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)Parameters
Section titled “Parameters”Returns
Section titled “Returns”Strikethrough(MarkdownText)
Section titled “Strikethrough(MarkdownText)”Wraps the content in strikethrough markers, which the GitHub Flavored Markdown extension defines.
public static MarkdownText Strikethrough(MarkdownText text)Parameters
Section titled “Parameters”textMarkdownText
Returns
Section titled “Returns”ToString()
Section titled “ToString()”public virtual string ToString()Returns
Section titled “Returns”Remarks
Section titled “Remarks”Returns Markdown.
operator +(MarkdownText, MarkdownText)
Section titled “operator +(MarkdownText, MarkdownText)”Joins two instances, keeping the escaping decision each of them was built with.
public static MarkdownText operator +(MarkdownText left, MarkdownText right)Parameters
Section titled “Parameters”leftMarkdownTextrightMarkdownText
Returns
Section titled “Returns”operator ==(MarkdownText, MarkdownText)
Section titled “operator ==(MarkdownText, MarkdownText)”Returns a value indicating whether both forms of other match this instance.
public static bool operator ==(MarkdownText left, MarkdownText right)Parameters
Section titled “Parameters”leftMarkdownTextrightMarkdownText
Returns
Section titled “Returns”implicit operator MarkdownText(string)
Section titled “implicit operator MarkdownText(string)”Converts plain text, escaping the characters that carry syntax.
public static implicit operator MarkdownText(string text)Parameters
Section titled “Parameters”textstring
Returns
Section titled “Returns”operator !=(MarkdownText, MarkdownText)
Section titled “operator !=(MarkdownText, MarkdownText)”Returns a value indicating whether both forms of other match this instance.
public static bool operator !=(MarkdownText left, MarkdownText right)Parameters
Section titled “Parameters”leftMarkdownTextrightMarkdownText