Description

If you have lists with numbers or letters and insert a comment line, the numbers do not increase further but restart at 1 or a, respectively.

Example

With the comment the list numbering starts again at 1:

  1. one
    • a
    • b
  2. two

But with comment:

  1. one
    • a
    • b

  1. two expected

Markup for this example:

 1. one
  * a
  * b
 2. two

But with comment:
 1. one
  * a
  * b
## comment
 2. two expected

Component selection

Details

This Wiki.

Workaround

Indent the comment line or move comment out of list region.

Discussion

A simple patch to the parser text_moin_wiki.py can resolve this issue.

Copy the parser text_moin_wiki.py from MoinMoin/parser to .../data/plugin/parser, and add the following patch.

   1              # ignore processing instructions
   2              if self.in_processing_instructions:
   3                  found = False
   4                  for pi in ("##", "#format", "#refresh", "#redirect", "#deprecated",
   5                             "#pragma", "#form", "#acl", "#language"):
   6                      if line.lower().startswith(pi):
   7                          self.request.write(self.formatter.comment(line))
   8                          found = True
   9                          break
  10                  if not found:
  11                      self.in_processing_instructions = 0
  12                  else:
  13                      continue # do not parse this line
  14                     
  15 +            # ignore comment lines beyond processing instructions
  16 +            # unless in parser section
  17 +            if line.startswith("##") and not self.in_pre:
  18 +                continue # do not parse this line
  19 + 

Within parser sections (self.in_pre == true), ##comment lines are not ignored, unless the parser section is {{{#!wiki....

This patch makes the checking for lines starting with ## after this point redundant, but this does not seem to create a problem.

Plan


CategoryMoinMoinBug CategoryForMoin2

MoinMoin: MoinMoinBugs/CommentBreaksListNumbering (last edited 2014-10-07 10:44:35 by IanRiley)