Class HtmlUtils

Html string and formatting utilities

System.Object
  Westwind.Utilities.HtmlUtils
public static class HtmlUtils : object

Class Members

MemberDescription

DisplayMemo

Fixes a plain text field for display as HTML by replacing carriage returns with the appropriate br and p tags for breaks.

public static string DisplayMemo(string htmlText)

DisplayMemoEncoded

Method that handles handles display of text by breaking text. Unlike the non-encoded version it encodes any embedded HTML text

public static string DisplayMemoEncoded(string text)

FixHTMLForDisplay

Replaces and and Quote characters to HTML safe equivalents.

public static string FixHTMLForDisplay(string html)

Href

Create an Href HTML link

public static string Href(string text,     string url,     string target,     string additionalMarkup)

public static string Href(string url)

HtmlAbstract

Creates an Abstract from an HTML document. Strips the HTML into plain text, then creates an abstract.

public static string HtmlAbstract(string html,     int length)

ImgRef

Returns an IMG link as a string. If the image is null or empty a blank string is returned.

public static string ImgRef(string imageUrl,     string additionalMarkup)

StripHtml

Strips HTML tags out of an HTML string and returns just the text.

public static string StripHtml(string html)

Requirements

Namespace: Westwind.Utilities
Assembly: westwind.utilities.dll

© West Wind Technologies, 2019 • Updated: 06/23/19
Comment or report problem with topic