From 576a71b2754d93055709520eb48ea713b8b9e989 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Thu, 21 Mar 2019 13:33:33 +0000 Subject: Table fixes, possibly incomplete --- tools/trac2md.py | 6 ++++-- 1 file 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") -- cgit v1.2.3