AutoYADM commit: 2025-03-25 01:00:07
This commit is contained in:
parent
c388bff977
commit
f73c297c0d
1 changed files with 23 additions and 0 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue