Displaying C/C++ Code Samples on XWiki page

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Displaying C/C++ Code Samples on XWiki page

Stephen Schaub
I'm having difficulty putting C/C++ code on an XWiki page:

{code}
#include <stdio.h>
{code}

or

{pre}
#include <stdio.h>
{/pre}

both result in exception stack trace in the web page.

When I try

{code}
\#include <stdio.h>
{code}

it works ok.

Escaping the #include with a backslash is an acceptable workaround in the
short term -- but shouldn't the {pre} or {code} tags disable the special
meaning of the # character?

Stephen





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Displaying C/C++ Code Samples on XWiki page

Ludovic Dubost

Hi,

This is because of velocity which is handled before.. Changing the
current behavior would break the cases where you want to generate
something in velocity and then display it in the {code} or {pre} tags..
I'm not sure how to handle this for backwards compatibility

I think we need to review the escaping mecanism with groovy, velocity,
radeox, html syntaxes..

Ludovic

Stephen Schaub wrote:

> I'm having difficulty putting C/C++ code on an XWiki page:
>
> {code}
> #include <stdio.h>
> {code}
>
> or
>
> {pre}
> #include <stdio.h>
> {/pre}
>
> both result in exception stack trace in the web page.
>
> When I try
>
> {code}
> \#include <stdio.h>
> {code}
>
> it works ok.
>
> Escaping the #include with a backslash is an acceptable workaround in
> the short term -- but shouldn't the {pre} or {code} tags disable the
> special meaning of the # character?
>
> Stephen
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
>  

--
Ludovic Dubost
XPertNet: http://www.xpertnet.fr/
Blog: http://www.ludovic.org/blog/
XWiki: http://www.xwiki.com
Skype: ldubost AIM: nvludo Yahoo: ludovic




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws