From 0e114758f6595b55eee51e498e048f2407874a5a Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 21 Mar 2019 14:14:53 +0000 Subject: No, Gogs is fine with both "*" and "-", problem is something else. --- tools/trac2md.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'tools') diff --git a/tools/trac2md.py b/tools/trac2md.py index 628f0c0..03d8861 100755 --- a/tools/trac2md.py +++ b/tools/trac2md.py @@ -162,16 +162,9 @@ def WikiToMD(content): # # Convert bullet lists. The start and end of a list needs - # an empty line. wikiformat uses both '*' and '-' for its - # lists. However, markdown only supports '*'. + # an empty line. # - if line.startswith('- '): - if not in_list: - new_content.append("\n") - in_list = True - line = line[1:] - line = '*%s' % (line) - elif line.startswith('* '): + if line.startswith('- ') or line.startswith('* '): # No need to modify the line, just add the new line if not in_list: new_content.append("\n") @@ -179,8 +172,7 @@ def WikiToMD(content): elif line.startswith(' '): # Check for nested lists nested_line = line.lstrip(' ') - if nested_line.startswith('* ') or \ - nested_line.startswith('- '): + if nested_line.startswith('* ') or nested_line.startswith('- '): # Adjust the nested list level as needed indent = len(line) - len(nested_line) if indent > prev_indent: @@ -190,8 +182,7 @@ def WikiToMD(content): prev_indent = indent # Set the proper indentation for markdown - line = ('%s*%s' % (' ' * nested_level, - nested_line[1:])) + line = ' ' * nested_level + nested_line else: if in_list: # Add the closing empty line -- cgit v1.2.3