[Cryptech-Commits] [user/sra/pelican] 08/68: Handle line splitting differently

git at cryptech.is git at cryptech.is
Mon Jul 19 22:24:47 UTC 2021


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch pelican
in repository user/sra/pelican.

commit e061ad3c5a99bde1b149f3d9d295fa92afa0de34
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Tue Mar 19 17:48:44 2019 +0000

    Handle line splitting differently
---
 tools/trac2md.py | 5 +++--
 1 file 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



More information about the Commits mailing list