17.2. Entering code and text with special characters
Special characters such as
*
, |
and #
, and HTML characters such as <
, >
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 <body> using the escape character: \. </p>
And we can quote code blocks with backticks:
My code does not work: `for (int i=0; i<100; i--) { doSomething(); }` Any ideas?
<p> My code does not work: </p> <pre>for (int i=0; i<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.