Search

17.2. Entering code and text with special characters

download PDF
Special characters such as *, | and #, and HTML characters such as <</literal>, <literal>> and & can be escaped with \:
        You can write down equations like 2\*3\=6 and HTML tags
        like \<body\> using the escape character: \\.
<p> 
  You can write down equations like 2*3=6 and HTML tags
  like &lt;body&gt; using the escape character: \. 
</p>
And we can quote code blocks with backticks:
        My code doesn't work:

        `for (int i=0; i<100; i--)
        {
        doSomething();
        }`

        Any ideas?
<p>
  My code doesn't work:
</p>

<pre>for (int i=0; i&lt;100; i--)
{
    doSomething();
}</pre>

<p>
  Any ideas?
</p>
Since most monospace-formatted text is either code, or involves special characters, inline monospace formatting always escapes. So, you can write:
This is a |<tag attribute="value"/>| example.
without escaping any of the characters inside the monospace bars. This also means that inline monospace text cannot be formatted in any other way.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.