From e061ad3c5a99bde1b149f3d9d295fa92afa0de34 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Tue, 19 Mar 2019 17:48:44 +0000 Subject: Handle line splitting differently --- tools/trac2md.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/trac2md.py b/tools/trac2md.py index 01d7f41..ab0bf79 100755 --- a/tools/trac2md.py +++ b/tools/trac2md.py @@ -115,10 +115,11 @@ def WikiToMD(content): in_list = False nested_level = 0 prev_indent = 0 + old_content = content.splitlines() new_content = [] - for line in content.split('\n'): - line = line.replace("\r", "") + while old_content: + line = old_content.pop(0).replace("\r", "") while "{{{" in line or "}}}" in line: if "{{{" in line: code_block = True -- cgit v1.2.3