Jelajahi Sumber

Don't lose our marbles when outermost list level is indented

Rob Austein 3 tahun lalu
induk
melakukan
8f033beb45
1 mengubah file dengan 2 tambahan dan 2 penghapusan
  1. 2 2
      trac2md.py

+ 2 - 2
trac2md.py

@@ -158,12 +158,12 @@ class Trac2Markdown:
                 #
                 nested_line = line.lstrip(' ')
                 if nested_line.startswith('- ') or nested_line.startswith('* '):
+                    indent = len(line) - len(nested_line)
                     if not in_list:
                         new_content.append("\n")
                         nested_level = 0
-                        prev_indent = 0
+                        prev_indent = indent
                         in_list = True
-                    indent = len(line) - len(nested_line)
                     text_indent = len(line) - len(nested_line[1:].lstrip())
                     if indent > prev_indent:
                         nested_level += 1