HTMLHelper Class |
Namespace: CMS.Helpers
public static class HTMLHelper
The HTMLHelper type exposes the following members.
Name | Description | |
---|---|---|
DEFAULT_XMLNS_ATTRIBUTE |
XMLNS attribute used in XHTML documents.
| |
DIVS |
CSS class marker to enable conversion of TABLE to DIV
| |
DOCTYPE_HTML5 |
HTML 5 document type.
| |
HTML_BREAK |
HTML break tag - "<br />".
| |
NO_DIVS |
CSS class marker to disable conversion of TABLE to DIV
|
Name | Description | |
---|---|---|
RegExHTMLEncode |
Regular expression for HTML encoding.
| |
RegexHtmlToTextHead |
Regular expression for removing entire head tag.
| |
RegexHtmlToTextScript |
Regular expression for removing entire script tag.
| |
RegexHtmlToTextStyle |
Regular expression for removing entire script tag.
| |
RegexHtmlToTextTags |
Regular expression for removing tags but keeps their content.
| |
RegexHtmlToTextWhiteSpace |
Regular expression for removing white spaces
| |
RegExStripTagsSpaces |
Regular expression match for new lines and spaces between tags.
|
Name | Description | |
---|---|---|
EncodeForHtmlAttribute |
Encodes string to be used as the HTML attribute value.
| |
EncodeForHtmlComment |
Encodes string to be used in a HTML comment.
| |
EnsureHtmlLineEndings |
Ensures the HTML line endings (<br />) in the given text.
| |
EnsureURLPrefixes |
Ensures that all local URLs have given prefix
| |
FixRTLText |
Fixes RTL text. Adds special marks at the end (at the beginning) of the text if it ends (starts) with weak unicode symbol.
| |
FixUrl |
Fixes the URL within given HTML code. The output code is HTML valid.
It changes '&' to '&' and backwards if needed.
'?test=1&test2=2' is changed to '?test=1&test2=2'
'&#13;' is changed to ' '.
'&lt;' is changed to '<'.
| |
FixXHTML |
Performs the HTML code fix to become valid XHTML. Method for complete fix solution.
| |
GetConvertTableEnum |
Converts the string representation to the ConvertTableEnum
| |
GetLink |
Returns the HTML link element that links to a related document.
| |
GetSafeColorFromHtml |
Returns color from HTML string color definition.
| |
GetUniqueControlID |
Gets the unique ID for the control, if some other control has the same base ID, adds the number at the end.
| |
HighlightHTML |
Highlight HTML.
| |
HTMLDecode |
HTML decoding function. Returns a string converted into an HTML-decoded string.
| |
HTMLEncode |
HTML encoding function. Returns a string converted into an HTML-encoded string.
Function does not encode previously encoded HTML entity (avoiding double HTML escaping).
| |
HTMLEncodeLineBreaks |
HTML encoding function. HTML encodes given text and replaces standard line breaks with "<br />" tag.
| |
HtmlToPlainText |
Converts HTML to the plain text (body part).
| |
LimitLength |
Limits the string length.
| |
ReformatHTML |
Reformats the HTML code indentation.
| |
RemoveComments |
Remove HTML comments from given text.
| |
RemoveScripts |
Removes the scripts from the given HTML text.
| |
ResolveCSSClientUrls |
Resolves client-relative URLs in CSS rules to absolute URLs (used with css files).
| |
ResolveCSSUrls |
Resolves application-relative URLs in CSS rules to absolute URLs (used with database style sheets).
| |
ResolveUrls |
Resolves relative URLs in the given HTML(string).
| |
SpanMsg |
Returns span (of specified CSS class) containing message.
| |
StripTags(String, Boolean, String) |
Remove HTML tags from text.
| |
StripTags(String, Boolean, Boolean, String, String, String) |
Remove HTML tags from text.
| |
UnResolveUrls |
Unresolves relative URI if used in "src=" or "href=" or "poster=" or "srcset=" or "url(".
|