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.11 00.11 MarkupToHTML begin
 3: 00.11 00.11 MarkupToHTML begin
 4: 00.12 00.11 MarkupToHTML end
 5: 00.12 00.11 MarkupToHTML begin
 6: 00.12 00.11 MarkupToHTML end
 7: 00.12 00.11 MarkupToHTML begin
 8: 00.12 00.12 MarkupToHTML end
 9: 00.12 00.12 MarkupToHTML begin
10: 00.12 00.12 MarkupToHTML end
11: 00.13 00.12 MarkupToHTML end
12: 00.13 00.13 MarkupToHTML begin
13: 00.14 00.13 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
14: 00.14 00.13 ReadApprovedUrls SiteAdmin.ApprovedUrls end
15: 00.15 00.14 MarkupToHTML end
16: 00.15 00.14 MarkupToHTML begin
17: 00.15 00.14 MarkupToHTML end
18: 00.16 00.14 now
Peak memory: 3,401,584 bytes