[pmwiki-users] New Recipe: IntuitiveSpacing

Patrick R. Michaud pmichaud at pobox.com
Thu Mar 15 14:26:56 CDT 2007


On Thu, Mar 15, 2007 at 07:15:30PM +0000, Hans wrote:
> Thursday, March 15, 2007, 5:56:40 PM, Ben wrote:
> 
> > To: Markup('spacing', '>^ws', "/(\\s{1,5})/e", "str_replace(' ',
> > ' ', '$1');");
> 
> Thanks! I needed to change it slighly, otherwise it converts all
> spaces, and does not allow wrapping (extra space in front of
> str_replace):
> 
> Markup('spacing', '>^ws', "/(\\s{2,7})/e",
>         " str_replace(' ',' ', '$1');");

Actually, you want to change only _leading_ spaces, so I think this should have
a caret, as in:

  Markup('spacing', '>^ws', "/^(\\s{1,7})/e",
          "str_replace(' ',' ', '$1');");

I think this is also the issue with Site.PageActions -- adding
the caret should fix that as well.

Pm



More information about the pmwiki-users mailing list