diff options
author | Rob Austein <sra@hactrn.net> | 2019-03-19 17:48:44 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2019-03-19 17:48:44 +0000 |
commit | e061ad3c5a99bde1b149f3d9d295fa92afa0de34 (patch) | |
tree | d35ec33cd2517a0665491f5c24f36d5c765b12d6 /tools | |
parent | 97fc9ee04159bb55554310cf65a5843a7a5f8847 (diff) |
Handle line splitting differently
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/trac2md.py | 5 |
1 files changed, 3 insertions, 2 deletions
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 |