AutoYADM commit: 2025-03-25 01:00:07

This commit is contained in:
Daniel Fichtinger 2025-03-25 01:00:07 -04:00
parent c388bff977
commit f73c297c0d

View file

@ -0,0 +1,23 @@
#!/bin/env python
import textwrap
import sys
with open(sys.argv[1], 'r') as f:
lines = f.read().splitlines()
skipping = False
for line in lines:
prefix = line.strip()[0]
match prefix:
case ">":
# ignore quoted line
print(line)
case "```":
# ignore code block
skipping = not skipping
case _:
# wrap the line
wrapped = textwrap.wrap(line, width=74, break_long_words=False, replace_whitespace=True)