> ## Documentation Index
> Fetch the complete documentation index at: https://docs.alumio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# String: Encode HTML entities

> Encodes all HTML entities in a string.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Makes a text value safe to place inside HTML by replacing special characters with their HTML entity codes, for example an ampersand (`&`) becomes `&amp;` and a less-than sign (`<`) becomes `&lt;`. Use this when you are building HTML output or sending text to a system that expects special characters to be escaped. This is the opposite of decoding HTML entities.

This documentation describes: [Schema](/schemas/mapper/string-html-entity-encode)

## Fields

This mapper has no settings. It always encodes the whole value.

## Sample data

| Field  | Value                                       |
| ------ | ------------------------------------------- |
| (none) | encodes special characters as HTML entities |

Input:

```json theme={null}
{ "title": "Tom & Jerry <Special>" }
```

Output:

```json theme={null}
{ "title": "Tom &amp; Jerry &lt;Special&gt;" }
```

```json Configuration theme={null}
{
  "prototype": "string-html-entity-encode",
  "parameters": {}
}
```
