[pmwiki-users] (:linebreaks:) oddness

marc gmane at auxbuss.com
Wed May 9 14:13:30 CDT 2007


Patrick R. Michaud said...
> On Wed, May 09, 2007 at 03:50:14PM +0100, marc wrote:
> > Pages with (:linebreaks:) are causing <br  /> to be inserted in a 
> > sidebar area included via:
> > 
> >   (:if ! authid :)(:include Site.AuxLogin :)
> > ...
> > Shouldn't the behaviour be limited to the page? Is there a fix?
> 
> While it's arguable that (:linebreaks:) should be limited to the
> page it is in, in general we've always had it that directives on 
> the main page can also affect things that appear in sidebar and 
> other pages.  

Fair enough. I just hadn't noticed before.

> At the moment the "fix" is to put (:nolinebreaks:) at the 
> beginning of the SideBar page, which guarantees that it won't
> be processed with linebreaks.

Okay, thanks.

> > and here's it with
> > 
> >   <p><legend class='legend' >Customer login
> >   <br  /></legend>
> >   <br  /><label for='authid' class='label' >User name
> >   <br  /></label><br /><input type='text' name='authid' class='text' />
> > <br />
> >   <br  /><label for='authpw' class='label' >Password
> >   <br  /></label><br /><input type='password' name='authpw' 
> > class='text' />
> >   <br /><input type='submit' value='Login' class='button' />
> >   </p>
> 
> It looks to me as though the markup that is creating the <legend>/<label>
> tags are perhaps also generating extra newlines or <br /> tags?

Eh? As mentioned, it is an artefact of the (:linebreaks:) markup.

A quick grep shows that the only occurrence of <br  /> in the farm is:

  ## (:linebreaks:)
  Markup('linebreaks', 'directives',
    '/\\(:(no)?linebreaks:\\)/ei',
    "PZZ(\$GLOBALS['HTMLPNewline'] = ('$1'!='no') ? '<br  />' : '')");

-- 
Cheers,
Marc




More information about the pmwiki-users mailing list