|
@ -70,15 +70,23 @@ def wrapMarkdownParagraphsToColLimit(fileName, charLimit): |
|
|
""" |
|
|
""" |
|
|
result = "" |
|
|
result = "" |
|
|
tempResult = "" |
|
|
tempResult = "" |
|
|
|
|
|
inCodeBlock = False |
|
|
|
|
|
|
|
|
with open(fileName) as file: |
|
|
with open(fileName) as file: |
|
|
for line in file: |
|
|
for line in file: |
|
|
if line.strip(" ") == "\n": |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if line.startswith("```"): |
|
|
|
|
|
inCodeBlock = not inCodeBlock |
|
|
|
|
|
result = result + line |
|
|
|
|
|
elif inCodeBlock: |
|
|
|
|
|
result = result + line |
|
|
|
|
|
elif line.strip(" ") == "\n": |
|
|
result = result + formatChunk(tempResult, charLimit) |
|
|
result = result + formatChunk(tempResult, charLimit) |
|
|
tempResult = "" |
|
|
tempResult = "" |
|
|
result = result + "\n" |
|
|
result = result + "\n" |
|
|
else: |
|
|
else: |
|
|
tempResult = tempResult + line |
|
|
tempResult = tempResult + line |
|
|
print(line) |
|
|
|
|
|
|
|
|
|
|
|
if tempResult != "": |
|
|
if tempResult != "": |
|
|
result = result + formatChunk(tempResult, charLimit) |
|
|
result = result + formatChunk(tempResult, charLimit) |
|
|
return result |
|
|
return result |
|
|