[pmwiki-users] (:linebreaks:) oddness

marc gmane at auxbuss.com
Thu May 10 03:54:14 CDT 2007


Patrick R. Michaud said...
> On Wed, May 09, 2007 at 08:13:30PM +0100, marc wrote:
> > Patrick R. Michaud said...
> > > 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  />' : '')");
> 
> Yes, but how many places does HTMLPNewline occur?  :-)

No idea. I don't understand what this has to do with your original 
comment about the markup creating <legend>/<label>.

Regardless, the (:nolinebreaks:) hack at the top of the sidebar fixes 
things.

> Beyond that, when (:linebreaks:) is active PmWiki just adds <br />
> to the end of paragraph markup lines, so whatever is generating
> the <legend> and <label> tags seems to generating extra lines of
> (paragraph) markup, and PmWiki is simply adding breaks to those lines.

Doesn't seem to.

function AuxForm($name,$attr) {
	$name = strtolower($name);
	$attr = PQA($attr);
	switch ($name) {
	case 'fieldsetend';
		$out = '</fieldset>'; break;
	case 'fieldset';
		$out = "<fieldset $attr>"; break;
	case 'legendend';
		$out = "</legend>"; break;
	case 'legend';
		$out = "<legend $attr>"; break;
	case 'labelend';
		$out = "</label>"; break;
	case 'label';
		$out = "<label $attr>"; break;
	}
	return $out;
}

Markup('auxform', 'block',
  '/\\(:(fieldset|fieldsetend|legend|legendend|label|labelend)(\\s.*?)?:
\\)/ie',
  "AuxForm('$1',PSS('$2'))");

And the same markup is used for the logged in equivalent is the login 
box, but the extra <br  />s don't appear there.

-- 
Cheers,
Marc




More information about the pmwiki-users mailing list