mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-08-04 10:08:20 +00:00
scripts/merge-pr.py: Don't wrap code blocks
This commit is contained in:
parent
ec94770d08
commit
0d04f0717f
1 changed files with 12 additions and 1 deletions
|
@ -70,7 +70,18 @@ def get_pr_info(g, repo, pr_number):
|
|||
|
||||
|
||||
def wrap_text(text, width=72):
|
||||
return '\n'.join(textwrap.wrap(text, width=width))
|
||||
lines = text.split('\n')
|
||||
wrapped_lines = []
|
||||
in_code_block = False
|
||||
for line in lines:
|
||||
if line.strip().startswith('```'):
|
||||
in_code_block = not in_code_block
|
||||
wrapped_lines.append(line)
|
||||
elif in_code_block:
|
||||
wrapped_lines.append(line)
|
||||
else:
|
||||
wrapped_lines.extend(textwrap.wrap(line, width=width))
|
||||
return '\n'.join(wrapped_lines)
|
||||
|
||||
|
||||
def merge_pr(pr_number):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue