diff options
author | Rob Austein <sra@hactrn.net> | 2019-03-21 13:33:33 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-03-21 13:33:33 +0000 |
commit | 576a71b2754d93055709520eb48ea713b8b9e989 (patch) | |
tree | a7238c882725131e93b3e66647eeea8319546f35 | |
parent | 156b5673fe5d0e6abccd53792817800ae87ca117 (diff) |
Table fixes, possibly incomplete
-rwxr-xr-x | tools/trac2md.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/trac2md.py b/tools/trac2md.py index 377cf20..5f440d3 100755 --- a/tools/trac2md.py +++ b/tools/trac2md.py @@ -150,13 +150,13 @@ def WikiToMD(content): # alignment, start with just getting the basic table # structure to something markdown will believe. # - if not code_block and line.strip().startswith("||"): + if line.strip().startswith("||"): line = line.replace("=|", "|").replace("|=", "|") line = line.replace("||", "|") if not in_table: tail.append("|---" * (line.count("|") - 1) + "|\n") in_table = True - elif not code_block and in_table and not line.strip().startswith("||"): + elif in_table and not line.strip().startswith("||"): new_content.append("\n") in_table = False @@ -165,6 +165,8 @@ def WikiToMD(content): # an empty line. wikiformat uses both '*' and '-' for its # lists. However, markdown only supports '-'. # + if line.strip().startswith("- "): + line = line.replace("-", "*", 1) if line.startswith('* '): if not in_list: new_content.append("\n") |