# HTMLSupport
Module
## About
`HTMLSupport` contains the parser, element representation, escaping, entity decoding, CSS parsing, and data-URI helpers used by node import and export implementations. It is primarily relevant to custom node authors.
Always escape user-provided element text and attribute values on export. Decode entities through the shared parser on import rather than applying ad hoc replacements. Restore every custom property represented by the HTML emitted from the node's own `ToHTML` implementation.
## Members
- [HTMLParser](/htmlparser.md)
- [HTMLElement](/htmlelement.md)
## Methods
| Name | Parameters | Return Type | Description |
| --- | :---: | :---: | --- |
| CSSColor | value As String <br> ByRef result As Color | Boolean | Parses a CSS color or a color embedded in a CSS shorthand value. |
| CSSColorString | value As Color | String | Returns an alpha-aware CSS rgba() color value for the supplied Xojo color. |
| CSSLength | value As String <br> fallback As Double = 0 | Double | Returns a CSS length in points, or the fallback when it cannot be read. |
| CSSLineMetrics | value As String <br> ByRef lineHeight As Double <br> ByRef lineSpacing As Double | Boolean | Reads a CSS line-height value as a multiple of the font size and extra spacing in points, and returns whether it could be read. |
| CSSPicture | value As String | Picture | Returns the picture referenced by a CSS url() value that holds a data URI, or Nil. |
| EscapeAttribute | value As String | String | Returns the supplied text escaped for an HTML attribute value. |
| EscapeText | value As String | String | Returns the supplied text escaped for HTML content. |
| FileDataURI | file As FolderItem | String | Returns a portable BASE64 data URI for the supplied local file. |
| MIMETypeForFile | file As FolderItem | String | Returns the MIME type inferred from the supplied file's extension. |
| PictureDataURI | value As Picture | String | Returns a self-contained PNG data URI for the supplied in-memory picture. |
| StyleDeclarations | element As HTMLElement | Dictionary | Returns the CSS declarations of the supplied element's style attribute, keyed by lowercase property name. |
| StyleDeclarations | value As String | Dictionary | Returns the CSS declarations in the supplied style text, keyed by lowercase property name. |
| StyleValue | element As HTMLElement <br> propertyName As String <br> defaultValue As String = "" | String | Returns the value of a CSS property in the supplied element's style attribute, or the default value. |