diff --git a/.config/mail/format.py b/.config/mail/format.py index d3b0a08c..f557b113 100755 --- a/.config/mail/format.py +++ b/.config/mail/format.py @@ -36,6 +36,7 @@ for line in sys.stdin: skipping = True print(line, end = "") elif not line.rstrip(): + # Empty line in_par = not in_par print() # print(line, end="") @@ -45,17 +46,20 @@ for line in sys.stdin: for next_line in sys.stdin: # if not line.startswith((">", "```", "--")): stripped = next_line.rstrip() + print("runs") if stripped: + print("runs") par.append(stripped) else: in_par = False + par.append("\n") break line = " ".join(par) + print(par) # empty line, treat next section as paragraph # TODO: fix signature being mangled and newlines erased if not skipping: wrapped = textwrap.wrap(line, width=74, break_long_words=False, replace_whitespace=True) - print("\n".join(wrapped)) else: print(line, end = "")