BugOrFeature


Using whitespace indentation to create new list levels

The following test examples are reorganized to build on observations from Christian (in this page) and Sean (in PITS 00722 referring to release notes for 2.1.0). Those release notes state, in relevant part:

  • Whitespace indentation rules now exist and are enabled by default. Any line that begins with whitespace and aligns with a previous list item is considered to be "within" that list item. Text folds and wraps as normal, and the directive is honored. To turn off whitespace indentation, use DisableMarkup('^ws');.

1. Normal bulleted list with multiple levels triggered by progressive markup

  • I think this one behaves correctly chr
*One *
**Two **
***Three ***
****Four ****
*****Five *****
  • One *
    • Two **
      • Three ***
        • Four ****
          • Five *****

2. Whitespace indentation rule applied "as directed"

Release notes: "Any line that begins with whitespace and aligns with a previous list item is considered to be "within" that list item."

*One *\\
 One space
**Two **\\
  Two spaces
***Three ***\\
   Three spaces
****Four ****\\
    Four spaces
*****Five *****\\
     Five spaces
  • One *
    One space
    • Two **
      Two spaces
      • Three ***
        Three spaces
        • Four ****
          Four spaces
          • Five *****
            Five spaces

3. Whitespace indentation taken one "step further"

Item markup ("*") following whitespce indentation is accepted and triggers a new level.

  • This one looks like it is misbehaving, or is it...? chr
*No Space
 *One Space
  *Two Space
   *Three Space
    *Four
  • No Space
    • One Space
      • Two Space
        • Three Space
          • Four

4. Whitespace indentation applied to various types of start of line markup

*Regular item (to set required reference)\\
 Text with space
 !Heading with space
 ----
 >>apply=list blue font-style=italic bgcolor=#ffffcc<<
 Style treated as literal 
 >><<
 ----
>>apply=list blue font-style=italic bgcolor=#ffffcc<<
*Style applied (no whitespace) and list item added as reference
 >><<
 Text
 (:attachlist ext=mp3:)

  • Regular item (to set required reference)
    Text with space

    Heading with space


    >>apply=list blue font-style=italic bgcolor=#ffffcc<< Style treated as literal >><<
  • Style applied (no whitespace) and list item added as reference >><< Text

C1. Christian's first variation

Breaking whitespace alignment by modifying the prior item causes item markup to be ignored.

*No Space
 * One Space, but with a space between the '*' and the 'O'
  *Two Space
   *Three Space
    *Four
  • No Space
    • One Space, but with a space between the '*' and the 'O'
  *Two Space
   *Three Space
    *Four

I know what the problem is... not sure if it is a bug or a feature though... compare these two examples:

C2 Christian's next variation

* Item 1A
  * Item 2A

* Item 1B
 * Item 2B
  • Item 1A
    • Item 2A
  • Item 1B
 * Item 2B

Notice how item 2A is a second level item while item 2B isn't. What is the difference? The answer
is actually quite simple. Item 2A is horizontally aligned under item 1A, while item 2B is not aligned under item 2A. This might actually be quite clever... right now I'm leaning towards this not being a bug, but an (unintended) feature. The behaviour might be considered a bug for enumerated lists though. chr


Original examples using ordered lists instead of bulleted lists

4. Ordered list with multiple levels triggered by progressive markup

#One #
##Two ##
###Three###
####Four ####
  1. One #
    1. Two ##
      1. Three###
        1. Four ####

5. Ordered list with multiple levels triggered by progressive spaces

#No Space
 #One Space
  #Two Space
   #Three Space
    #Four
  1. No Space
    1. One Space
      1. Two Space
        1. Three Space
          1. Four
 0: 00.00 00.00 config start
 1: 00.01 00.00 config end
 2: 00.05 00.02 MarkupToHTML begin
 3: 00.05 00.02 MarkupToHTML begin
 4: 00.06 00.03 MarkupToHTML end
 5: 00.06 00.03 MarkupToHTML begin
 6: 00.06 00.03 MarkupToHTML end
 7: 00.06 00.03 MarkupToHTML begin
 8: 00.06 00.03 MarkupToHTML end
 9: 00.06 00.03 MarkupToHTML begin
10: 00.07 00.04 MarkupToHTML end
11: 00.07 00.04 MarkupToHTML begin
12: 00.07 00.04 MarkupToHTML end
13: 00.07 00.04 MarkupToHTML begin
14: 00.07 00.04 MarkupToHTML end
15: 00.07 00.04 MarkupToHTML begin
16: 00.07 00.04 MarkupToHTML end
17: 00.07 00.04 MarkupToHTML begin
18: 00.07 00.04 MarkupToHTML end
19: 00.09 00.06 MarkupToHTML end
20: 00.09 00.06 MarkupToHTML begin
21: 00.10 00.07 ReadApprovedUrls SiteAdmin.ApprovedUrls begin
22: 00.10 00.07 ReadApprovedUrls SiteAdmin.ApprovedUrls end
23: 00.11 00.07 MarkupToHTML end
24: 00.11 00.07 MarkupToHTML begin
25: 00.11 00.08 MarkupToHTML end
26: 00.11 00.08 now
Peak memory: 3,147,936 bytes