summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-03-21 14:14:53 +0000
committerRob Austein <sra@hactrn.net>2019-03-21 14:14:53 +0000
commit0e114758f6595b55eee51e498e048f2407874a5a (patch)
treed3d620a3ea06f9fc4b2e57c5a131964225fda550
parent7ef4f4f76f22cbf692069ab074359db072410673 (diff)
No, Gogs is fine with both "*" and "-", problem is something else.
-rwxr-xr-xtools/trac2md.py17
1 files changed, 4 insertions, 13 deletions
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