////
Included in:

- user-manual: Text Substitutions: Special characters
////

When applicable, the first text substitution to occur is the replacement of any special characters.
This process is handled by the `specialchars` element.
The specialchars element searches for three characters (`<`, `>`, `&`) and replaces them with their <<char-ref-sidebar,named character references>>.

* The less than symbol, `<`, is replaced with the named character reference `\&lt;`.
* The greater than symbol, `>`, is replaced with the named character reference `\&gt;`.
* An ampersand, `&`, is replaced with the named character reference `\&amp;`.

By default, the special characters substitution occurs on all inline and block elements except for comments and certain passthroughs.
The substitution of special characters can be controlled on blocks using the <<user-manual#applying-substitutions, subs attribute>> and on inline elements using the <<user-manual#passthroughs,passthrough macro>>.

[NOTE]
====
Special character substitution precedes attribute substitution, so you will need to manually escape any attributes containing special characters that you set in the CLI or API.
For example, on the command line, type `-a toc-title="Sections, Tables \&amp; Figures"` instead of `-a toc-title="Sections, Tables & Figures"`.
====
