summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2019-03-19 17:48:44 +0000
committerRob Austein <sra@hactrn.net>2019-03-19 17:48:44 +0000
commite061ad3c5a99bde1b149f3d9d295fa92afa0de34 (patch)
treed35ec33cd2517a0665491f5c24f36d5c765b12d6
parent97fc9ee04159bb55554310cf65a5843a7a5f8847 (diff)
Handle line splitting differently
-rwxr-xr-xtools/trac2md.py5
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