[pmwiki-users] Undesired space combined with (:if ...:)

Patrick R. Michaud pmichaud at pobox.com
Sat Aug 6 18:03:41 CDT 2005


On Sun, Aug 07, 2005 at 12:34:45AM +0200, chr at home.se wrote:
> I just started using conditional statements and noticed something that I 
> find annoying. If I write something like this:
> 
> 	* Item A
> 	(:if false:)
> 	* Item never shown
> 	(:ifend:)
> 	* Item B
> 
> where the condition is true, I get this result that I find unintuitive
> 
> 	* Item A
> 
> 	* Item B
> 
> I'd much prefer this result:
> 
> 	* Item A
> 	* Item B

I'm still working on the idea that only lines that are truly
blank in the markup produce blank lines in the output.  Thus
in the above, the (:if false:) and (:ifend:) wouldn't result in
blank lines.  (But this might not help in the above case anyway,
because of the way that if's are handled.)

The real way to write the above is probably

 	* Item A
 	(:if false:)* Item never shown
        (:ifend:)* Item B


This is also in keeping with the way to do multiple conditions:

	* Item A
	(:if auth edit:)* Item B
        (:if auth attr:)* Item C
        (:ifend:)

But I think the full truth is that with conditionaal markup (and
preformatted text) no matter how we set it up to handle blank lines
we'll end up with something that doesn't seem to work right to someone.

Pm




More information about the pmwiki-users mailing list