Introduction
Due to the way the Confluence renderer works, outputting a sequence of two '\' characters right next to each other is nigh-on impossible. It can be done by using a {noformat} macro (mostly), but it will force it into it's own paragraph. The 'escape' macro lets you get around this problem.
Instructions
The way I got it to work was to create my own 'escape' macro that converted the sequence '*', where '' is any single character, in to ''. It looks like this in the macro:
Step 1: Create a new User Macro
- Go to the Administration section and create a new User Macro.
- Call it 'escape'.
- Enter the following as the macro content:
${body.replaceAll("\\(.)", "$1")} - Save it.
Step 2: Use the macro
In the page, it use it like this:
{escape}\\\\server\\share\\dir\\\%variable\%{escape}
When rendered, it looks like this:
\\server\share\dir\%variable%
Except that you can have the value inline in any regular paragraph.

Comments (2)
Sep 18, 2007
James Mortimer says:
why not use a {norender} macro? Create a user macro with this content ${genera...why not use a {norender} macro? Create a user macro with this content
${generalUtil.htmlEncode($body)}now,
{norender}\\server\share\dir\%variable%{norender}simply gives
Aug 16, 2006
William W. Lin says:
I found on a separate thread that you can do double backslashes without using no...I found on a separate thread that you can do double backslashes without using noformat or macro tricks by simply using the ASCII code. So this raw Wiki markup:
shows up as:
\\server\share\dir\%variable%
(note that I had to use the ASCII code before the %, because the backslash acts as an escape character before percentage signs)