[pmwiki-users] formatting pre-formatted text!

Patrick R. Michaud pmichaud at pobox.com
Sat Sep 2 23:31:58 CDT 2006


On Sat, Sep 02, 2006 at 10:11:24PM -0500, Tegan Dowling wrote:
> On 9/2/06, Mohamed El Dawy <msdawy at yahoo.com> wrote:
> >
> > Hi,
> >  First, thanks a lot for doing PMWiki. I really love it. It is amazing.
> >
> >  I am trying to include a few lines of source code on my wiki page, so i put
> > them in a preformatted tag like this...
> >
> > [@
> >    source code goes here
> > @]
> >
> > Now, here is the tricky thing. I am trying to make certain lines of the code
> > bold. I need this to point out the changes made to a previous piece of code.
> > Now, if i try this...
> > [@
> >    ''' cout<<"hello world"<<endl; '''
> > @]
> > the line of code is displayed with 3 quotes before and after (not made
> > bold).

Yes, because PmWiki won't interpret things inside of [@...@]
(because there's not much way to know if it's code or markup).

> > is there anyway to achieve this? I have to use the preformatted tag to
> > preserve the indentation.
> 
> would this be an acceptable work-around?
> @@ &nbsp; ''' cout<<"hello world"<<endl; ''' @@

Try just leading spaces on the line, without anything around it:

    <space><space><space><space>'''cout<<"hello world"<<endl;'''

If it's in the middle of a code segment, then perhaps the following
will work:

    [@
         code;
         code;
         code;
    @]
         '''cout<<"hello world"<<endl;'''
    [@
         more code;
         more code;
    @]

Pm




More information about the pmwiki-users mailing list