diff options
author | Rob Austein <sra@hactrn.net> | 2019-03-21 14:06:56 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-03-21 14:06:56 +0000 |
commit | 7ef4f4f76f22cbf692069ab074359db072410673 (patch) | |
tree | 4cb88ad72330ce16f0ca5b970e46ffdfaebc56c8 | |
parent | 576a71b2754d93055709520eb48ea713b8b9e989 (diff) |
Gogs seems not to like "-" as start of list entry
-rwxr-xr-x | tools/trac2md.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/trac2md.py b/tools/trac2md.py index 5f440d3..628f0c0 100755 --- a/tools/trac2md.py +++ b/tools/trac2md.py @@ -163,17 +163,15 @@ 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 '-'. + # lists. However, markdown only supports '*'. # - if line.strip().startswith("- "): - line = line.replace("-", "*", 1) - if line.startswith('* '): + if line.startswith('- '): if not in_list: new_content.append("\n") in_list = True line = line[1:] - line = '-%s' % (line) - elif line.startswith('- '): + line = '*%s' % (line) + elif line.startswith('* '): # No need to modify the line, just add the new line if not in_list: new_content.append("\n") @@ -192,7 +190,7 @@ def WikiToMD(content): prev_indent = indent # Set the proper indentation for markdown - line = ('%s-%s' % (' ' * nested_level, + line = ('%s*%s' % (' ' * nested_level, nested_line[1:])) else: if in_list: |