ConditionalStatementsAndVerticalSpace


This page illustrates a problem with (:if ...:) and vertical space.

Let's say we want to produce a list where an item is only shown if a condition is satisfied:

* Item A
(:if true:)
* Item - true
(:ifend:)
* Item B
* Item C
(:if false:)
* Item - false
(:ifend:)
* Item D
  • Item A
  • Item - true
  • Item B
  • Item C
  • Item D

Notice the extra vertical space in the item list...

Here is a possible workaround:

* Item A - (:if true:)
* Item - true
(:ifend:)* Item B
* Item C (:if false:)
* Item - false (:ifend:)
* Item D
  • Item A -
  • Item - true
  • Item B
  • Item C
  • Item D

A slightly nicer looking workaround:

* Item A - \
(:if true:)
* Item - true \
(:ifend:)
* Item B
* Item C \
(:if false:)
* Item - false \
(:ifend:)
* Item D
  • Item A -
  • Item - true
  • Item B
  • Item C
  • Item D

Here is every item inside an if-line, every item takes one line.
The false item occupies a line and shows as a blank line.
Seem logical to me. ~HansB

* Item A - 
(:if true:)* Item B - true(:ifend:)
* Item C 
(:if false:)* Item D - false (:ifend:)
* Item E
  • Item A -
  • Item B - true
  • Item C
  • Item E
 0: 00.00 00.00 config start
 1: 00.01 00.01 config end
 2: 00.21 00.21 MarkupToHTML begin
 3: 00.21 00.21 MarkupToHTML begin
 4: 00.22 00.22 MarkupToHTML end
 5: 00.22 00.22 MarkupToHTML begin
 6: 00.22 00.22 MarkupToHTML end
 7: 00.22 00.22 MarkupToHTML begin
 8: 00.23 00.22 MarkupToHTML end
 9: 00.23 00.22 MarkupToHTML begin
10: 00.23 00.22 MarkupToHTML end
11: 00.23 00.23 MarkupToHTML end
12: 00.24 00.23 MarkupToHTML begin
13: 00.24 00.24 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
14: 00.25 00.24 ReadApprovedUrls SiteAdmin.ApprovedUrls end
15: 00.25 00.25 MarkupToHTML end
16: 00.25 00.25 MarkupToHTML begin
17: 00.26 00.25 MarkupToHTML end
18: 00.26 00.25 now
Peak memory: 3,746,928 bytes