How does one italicize code with backslashes in these forums?

1

I looked through some of the formatting posts on this site but didn't find an answer (or in my case one that worked or made sense not understanding those posters' contexts). I even did a separate search for escape-character which showed up when adding tags for my question and found nothing in the first 150 posts.

How would I italicize a particular directory specified the Microsoft way:

I want to make username italic in code so the reader knows to substitute their username in case they copy and paste: C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files. (I ended up just making the directory uppercase to stand out as bold also didn't work. See https://superuser.com/a/1212196/308961 )

If I select the text to be italicized in code back-ticks it shows as ...*username*... I also tried surrounding with <i> and </i> and underscores but it just shows those mark up/down characters).

I tried escaping the backslash with a double-backslash but just got two backslashes in a row.

I searched for "markdown escape character" and "markup escape character" but didn't get anything relative to this web site.

What's the key for making what is often an escape character not escape something on these web pages or for generating italic text in a code block?

PReinie

Posted 2017-05-23T23:14:31.053

Reputation: 53

Answers

4

I want to make username italic in code

Format the code block using <pre> ... </pre> and surround the italic text with <i> ... </i>

Example:

<pre>
C:\Users\<i>username</i>\AppData\Local\Microsoft\Windows\Temporary Internet Files
</pre>

Output

C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files

You can also use <code> ... </code> and escape the first \* with an additional backslash instead of using <i> ... </i> but that doesn't look as nice (there is a extra line containing single block of the wrong background color above the code block)

Example:

<code>
C:\Users\\*username*\AppData\Local\Microsoft\Windows\Temporary Internet Files
</code>

Output

C:\Users\username\AppData\Local\Microsoft\Windows\Temporary Internet Files

DavidPostill

Posted 2017-05-23T23:14:31.053

Reputation: 118 938